support extraLabels for vault-agent-injector (#428)
* support extraLabels for vault-agent-injector * added unit test for extraLabels * fix test * added injector.extraLabels as empty map to values file
This commit is contained in:
parent
136fe024c9
commit
a11a75d1b5
3 changed files with 19 additions and 0 deletions
|
@ -23,6 +23,9 @@ spec:
|
|||
app.kubernetes.io/name: {{ template "vault.name" . }}-agent-injector
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
component: webhook
|
||||
{{- if .Values.injector.extraLabels -}}
|
||||
{{- toYaml .Values.injector.extraLabels | nindent 8 -}}
|
||||
{{- end -}}
|
||||
{{ template "injector.annotations" . }}
|
||||
spec:
|
||||
{{ template "injector.affinity" . }}
|
||||
|
|
|
@ -531,3 +531,15 @@ load _helpers
|
|||
yq '.spec.template.spec.securityContext.runAsGroup | length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
#--------------------------------------------------------------------
|
||||
# extra labels
|
||||
|
||||
@test "injector/deployment: specify extraLabels" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
--show-only templates/injector-deployment.yaml \
|
||||
--set 'injector.extraLabels.foo=bar' \
|
||||
. | tee /dev/stderr |
|
||||
yq -r '.spec.template.metadata.labels.foo' | tee /dev/stderr)
|
||||
[ "${actual}" = "bar" ]
|
||||
}
|
||||
|
|
|
@ -134,6 +134,10 @@ injector:
|
|||
# of the annotations to apply to the injector pods
|
||||
annotations: {}
|
||||
|
||||
# Extra labels to attach to the agent-injector
|
||||
# This should be a YAML map of the labels to apply to the injector
|
||||
extraLabels: {}
|
||||
|
||||
# Injector service specific config
|
||||
service:
|
||||
# Extra annotations to attach to the injector service
|
||||
|
|
Loading…
Reference in a new issue