fix(credentials): allow credentials to be defined as credentialsList

This commit is contained in:
Kjeld Schouten
2024-04-28 21:14:28 +02:00
parent 096d349017
commit d2ef9c04a2
6 changed files with 20 additions and 60 deletions

View File

@@ -15,7 +15,7 @@ maintainers:
name: common
sources: null
type: library
version: 21.0.0
version: 21.0.1
annotations:
artifacthub.io/category: "integration-delivery"
artifacthub.io/license: "BUSL-1.1"

View File

@@ -10,14 +10,10 @@
{{- include "tc.v1.common.values.ingressList" . -}}
{{- include "tc.v1.common.values.backupStorageLocationList" . -}}
{{- include "tc.v1.common.values.volumeSnapshotLocationList" . -}}
{{- include "tc.v1.common.values.volumeSnapshotList" . -}}
{{- include "tc.v1.common.values.volumeSnapshotClassList" . -}}
{{- include "tc.v1.common.values.schedulesList" . -}}
{{- include "tc.v1.common.values.credentialsList" . -}}
{{- end -}}

View File

@@ -1,18 +0,0 @@
{{- define "tc.v1.common.values.backupStorageLocationList" -}}
{{- $rootCtx := . -}}
{{- range $idx, $bslValues := $rootCtx.Values.backupStorageLocationList -}}
{{- $name := (printf "bsl-list-%s" (toString $idx)) -}}
{{- with $bslValues.name -}}
{{- $name = . -}}
{{- end -}}
{{- if not (hasKey $rootCtx.Values "backupStorageLocation") -}}
{{- $_ := set $rootCtx.Values "backupStorageLocation" dict -}}
{{- end -}}
{{- $_ := set $rootCtx.Values.backupStorageLocation $name $bslValues -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,18 @@
{{- define "tc.v1.common.values.credentialsList" -}}
{{- $rootCtx := . -}}
{{- range $idx, $credsValues := $rootCtx.Values.credentialsList -}}
{{- $name := (printf "vs-list-%s" (toString $idx)) -}}
{{- with $credsValues.name -}}
{{- $name = . -}}
{{- end -}}
{{- if not (hasKey $rootCtx.Values "credentials") -}}
{{- $_ := set $rootCtx.Values "credentials" dict -}}
{{- end -}}
{{- $_ := set $rootCtx.Values.credentials $name $credsValues -}}
{{- end -}}
{{- end -}}

View File

@@ -1,18 +0,0 @@
{{- define "tc.v1.common.values.schedulesList" -}}
{{- $rootCtx := . -}}
{{- range $idx, $scheduleValues := $rootCtx.Values.schedulesList -}}
{{- $name := (printf "schedules-list-%s" (toString $idx)) -}}
{{- with $scheduleValues.name -}}
{{- $name = . -}}
{{- end -}}
{{- if not (hasKey $rootCtx.Values "schedules") -}}
{{- $_ := set $rootCtx.Values "schedules" dict -}}
{{- end -}}
{{- $_ := set $rootCtx.Values.schedules $name $scheduleValues -}}
{{- end -}}
{{- end -}}

View File

@@ -1,18 +0,0 @@
{{- define "tc.v1.common.values.volumeSnapshotLocationList" -}}
{{- $rootCtx := . -}}
{{- range $idx, $vslValues := $rootCtx.Values.volumeSnapshotLocationList -}}
{{- $name := (printf "vs-list-%s" (toString $idx)) -}}
{{- with $vslValues.name -}}
{{- $name = . -}}
{{- end -}}
{{- if not (hasKey $rootCtx.Values "volumeSnapshotLocation") -}}
{{- $_ := set $rootCtx.Values "volumeSnapshotLocation" dict -}}
{{- end -}}
{{- $_ := set $rootCtx.Values.volumeSnapshotLocation $name $vslValues -}}
{{- end -}}
{{- end -}}