Fix ha standby and active service annotations (#268)
* service: fix annotations for HA standby/active services * added unit tests Co-authored-by: yotsub <63680950+yotsub@users.noreply.github.com>
This commit is contained in:
parent
39631aad6b
commit
2072bf2dcd
4 changed files with 30 additions and 2 deletions
|
@ -14,7 +14,7 @@ metadata:
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- if .Values.server.service.annotations }}
|
{{- if .Values.server.service.annotations }}
|
||||||
{{ toYaml .Values.server.service.annotations | indent 4 }}
|
{{ tpl .Values.server.service.annotations . | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
|
|
@ -14,7 +14,7 @@ metadata:
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- if .Values.server.service.annotations }}
|
{{- if .Values.server.service.annotations }}
|
||||||
{{ toYaml .Values.server.service.annotations | indent 4 }}
|
{{ tpl .Values.server.service.annotations . | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
|
14
test/unit/server-ha-active-service.bats
Normal file
14
test/unit/server-ha-active-service.bats
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
load _helpers
|
||||||
|
|
||||||
|
@test "server/ha-active-Service: generic annotations" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-ha-active-service.yaml \
|
||||||
|
--set 'server.ha.enabled=true' \
|
||||||
|
--set 'server.service.annotations=vaultIsAwesome: true' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.metadata.annotations["vaultIsAwesome"]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
14
test/unit/server-ha-standby-service.bats
Normal file
14
test/unit/server-ha-standby-service.bats
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
load _helpers
|
||||||
|
|
||||||
|
@test "server/ha-standby-Service: generic annotations" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-ha-standby-service.yaml \
|
||||||
|
--set 'server.ha.enabled=true' \
|
||||||
|
--set 'server.service.annotations=vaultIsAwesome: true' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.metadata.annotations["vaultIsAwesome"]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
Loading…
Reference in a new issue