mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-02 23:47:54 -03:00
add validation
This commit is contained in:
@@ -17,6 +17,7 @@ backup:
|
||||
{{/* Fetch provider data */}}
|
||||
{{/* Get the creds defined in backup.$provider */}}
|
||||
{{- $creds := (get $rootCtx.Values.credentials $objectData.backups.credentials) -}}
|
||||
{{ $provider := $creds.type -}}
|
||||
{{- include (printf "tc.v1.common.lib.cnpg.cluster.barmanObjectStoreConfig.%s" $provider) (dict "rootCtx" $rootCtx "objectData" $objectData "data" $creds "type" "backup") | nindent 4 -}}
|
||||
{{- include "tc.v1.common.lib.credentials.validation" (dict "rootCtx" $rootCtx "caller" "CNPG Backup" "credName" $objectData.backups.credentials) -}}
|
||||
|
||||
{{- include (printf "tc.v1.common.lib.cnpg.cluster.barmanObjectStoreConfig.%s" $creds.type) (dict "rootCtx" $rootCtx "objectData" $objectData "data" $creds "type" "backup") | nindent 4 -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -15,7 +15,8 @@ externalClusters:
|
||||
{{/* Fetch provider data */}}
|
||||
{{/* Get the creds defined in backup.$provider */}}
|
||||
{{- $creds := (get $rootCtx.Values.credentials $objectData.recovery.credentials) -}}
|
||||
{{ $provider := $creds.type -}}
|
||||
{{- include (printf "tc.v1.common.lib.cnpg.cluster.barmanObjectStoreConfig.%s" $provider) (dict "rootCtx" $rootCtx "objectData" $objectData "data" $creds "type" "recovery") | nindent 6 -}}
|
||||
{{- include "tc.v1.common.lib.credentials.validation" (dict "rootCtx" $rootCtx "caller" "CNPG Recovery External Cluster" "credName" $objectData.recovery.credentials) -}}
|
||||
|
||||
{{- include (printf "tc.v1.common.lib.cnpg.cluster.barmanObjectStoreConfig.%s" $creds.type) (dict "rootCtx" $rootCtx "objectData" $objectData "data" $creds "type" "recovery") | nindent 6 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
{{/* Get the creds defined in backup.$provider */}}
|
||||
{{- $creds = (get $rootCtx.Values.credentials $objectData.backups.credentials) -}}
|
||||
{{- $provider = $creds.type -}}
|
||||
{{- include "tc.v1.common.lib.credentials.validation" (dict "rootCtx" $rootCtx "caller" "CNPG Backup" "credName" $objectData.backups.credentials) -}}
|
||||
{{- else if eq $type "recovery" -}}
|
||||
{{/* Get the creds defined in recovery.$provider */}}
|
||||
{{- $creds = (get $rootCtx.Values.credentials $objectData.recovery.credentials) -}}
|
||||
{{- $provider = $creds.type -}}
|
||||
{{- include "tc.v1.common.lib.credentials.validation" (dict "rootCtx" $rootCtx "caller" "CNPG Backup" "credName" $objectData.recovery.credentials) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include (printf "tc.v1.common.lib.cnpg.provider.%s.validation" $provider) (dict "objectData" $objectData "creds" $creds) -}}
|
||||
|
||||
Reference in New Issue
Block a user