Skip to content

Commit

Permalink
Merge branch 'main' into jm/NET-10194
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret authored Jul 29, 2024
2 parents 3ab9325 + 7a34565 commit f6e89d3
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/4210.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
helm: adds imagePullSecret to the gateway-resources job and the gateway-cleanup job, would fail before if the image was in a private registry
```
6 changes: 6 additions & 0 deletions charts/consul/templates/gateway-cleanup-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ metadata:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
component: gateway-cleanup
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ .name }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/consul/templates/gateway-resources-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ metadata:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
component: gateway-resources
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ .name }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 1 addition & 3 deletions charts/consul/test/unit/dns-proxy-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ load _helpers
.
}

@test "dnsProxy/Deployment: enable with global.enabled false, client.enabled true" {
@test "dnsProxy/Deployment: enable with dns.proxy.enabled" {
cd `chart_dir`
local actual=$(helm template \
-s templates/dns-proxy-deployment.yaml \
--set 'global.enabled=false' \
--set 'client.enabled=true' \
--set 'dns.proxy.enabled=true' \
. | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
Expand Down
22 changes: 22 additions & 0 deletions charts/consul/test/unit/gateway-cleanup-serviceaccount.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,25 @@ target=templates/gateway-cleanup-serviceaccount.yaml
.
}

#--------------------------------------------------------------------
# global.imagePullSecrets

@test "gatewaycleanup/ServiceAccount: can set image pull secrets" {
cd `chart_dir`
local object=$(helm template \
-s templates/gateway-cleanup-serviceaccount.yaml \
--set 'connectInject.enabled=true' \
--set 'global.imagePullSecrets[0].name=my-secret' \
--set 'global.imagePullSecrets[1].name=my-secret2' \
. | tee /dev/stderr)

local actual=$(echo "$object" |
yq -r '.imagePullSecrets[0].name' | tee /dev/stderr)
[ "${actual}" = "my-secret" ]

local actual=$(echo "$object" |
yq -r '.imagePullSecrets[1].name' | tee /dev/stderr)
[ "${actual}" = "my-secret2" ]
}


20 changes: 20 additions & 0 deletions charts/consul/test/unit/gateway-resources-serviceaccount.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ target=templates/gateway-resources-serviceaccount.yaml
.
}

#--------------------------------------------------------------------
# global.imagePullSecrets

@test "gatewayresources/ServiceAccount: can set image pull secrets" {
cd `chart_dir`
local object=$(helm template \
-s templates/gateway-resources-serviceaccount.yaml \
--set 'connectInject.enabled=true' \
--set 'global.imagePullSecrets[0].name=my-secret' \
--set 'global.imagePullSecrets[1].name=my-secret2' \
. | tee /dev/stderr)

local actual=$(echo "$object" |
yq -r '.imagePullSecrets[0].name' | tee /dev/stderr)
[ "${actual}" = "my-secret" ]

local actual=$(echo "$object" |
yq -r '.imagePullSecrets[1].name' | tee /dev/stderr)
[ "${actual}" = "my-secret2" ]
}

0 comments on commit f6e89d3

Please sign in to comment.