Skip to content

Commit 98e73fc

Browse files
committed
accept only object based imagepullsecrets
1 parent 2424a8d commit 98e73fc

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ You need to substitute the username and password with the credentials we provide
4444
```yaml
4545
global:
4646
imagePullSecrets:
47-
- my-image-pull-secret
47+
- name: my-image-pull-secret
48+
- name: my-other-image-pull-secret
49+
...
4850
```
4951

5052

charts/vaas/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: vaas
3-
version: 3.0.3
3+
version: 3.1.0
44
description: Deployment of a Verdict-as-a-Service on-premise instance
55
maintainers:
66
- name: G DATA CyberDefense AG

charts/vaas/templates/gateway/_helpers.tpl

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,14 @@ If release name contains chart name it will be used as a full name.
3333
{{- if or $hasIps $hasLocal $hasGlobalImagePullSecret $hasGlobalDockerconfig }}
3434
imagePullSecrets:
3535
{{- range $i, $entry := $ips }}
36-
{{- if kindIs "string" $entry }}
37-
- name: {{ $entry }}
38-
{{- else if kindIs "map" $entry }}
39-
{{- if hasKey $entry "name" }}
40-
- name: {{ get $entry "name" }}
41-
{{- else if hasKey $entry "secretName" }}
42-
- name: {{ get $entry "secretName" }}
43-
{{- else }}
44-
{{- fail (printf "global.imagePullSecrets[%d] must have key 'name' (or 'secretName'). Got keys: %v" $i (keys $entry)) }}
45-
{{- end }}
46-
{{- else }}
47-
{{- fail (printf "global.imagePullSecrets[%d] has unsupported kind %s (type %s)" $i (kindOf $entry) (typeOf $entry)) }}
36+
{{- if not (kindIs "map" $entry) -}}
37+
{{- fail (printf "global.imagePullSecrets[%d] must be an object with 'name' (or 'secretName'), not %s" $i (kindOf $entry)) -}}
38+
{{- end -}}
39+
{{- $name := (get $entry "name") | default (get $entry "secretName") -}}
40+
{{- if not $name -}}
41+
{{- fail (printf "global.imagePullSecrets[%d] must contain key 'name' or 'secretName'. Got keys: %v" $i (keys $entry)) -}}
4842
{{- end }}
43+
- name: {{ $name }}
4944
{{- end }}
5045

5146
{{- if $hasLocal }}
@@ -58,12 +53,10 @@ imagePullSecrets:
5853
- name: {{ include "gateway.fullname" . }}-global-dockerconfigjson
5954
{{- end }}
6055
{{- else -}}
61-
{{- fail "You have to set at least one imagePullSecret (global.imagePullSecrets, imagePullSecret, global.secret.imagePullSecret or global.secret.dockerconfigjson)" }}
56+
{{- fail "You have to set at least one imagePullSecret: use global.imagePullSecrets (objects with 'name'/'secretName') or set imagePullSecret/global.secret.*" }}
6257
{{- end -}}
6358
{{- end -}}
6459

65-
66-
6760
{{/*
6861
Create chart name and version as used by the chart label.
6962
*/}}

0 commit comments

Comments
 (0)