fix(deployment): avoid duplicated nodeSelector #980
Some checks failed
changelog / changelog (push) Has been cancelled
check-and-test / check-and-test (push) Has been cancelled

This commit is contained in:
2025-11-05 18:31:31 +01:00
parent b0961383ee
commit b88abaa1e7
2 changed files with 21 additions and 3 deletions

View File

@@ -370,9 +370,9 @@ spec:
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- range $key, $value := .Values.nodeSelector }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ $key }}: {{ $value | quote }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:

View File

@@ -29,6 +29,24 @@ tests:
path: spec.template.metadata.labels
content:
hello: world
- it: nodeSelector is undefined
asserts:
- notExists:
path: spec.template.spec.nodeSelector
template: templates/gitea/deployment.yaml
- it: nodeSelector is defined
set:
nodeSelector:
foo: bar
bar: foo
asserts:
- isSubset:
path: spec.template.spec.nodeSelector
content:
foo: bar
bar: foo
template: templates/gitea/deployment.yaml
- it: "injects TMP_EXISTING_ENVS_FILE as environment variable to 'init-app-ini' init container"
template: templates/gitea/deployment.yaml
asserts:
@@ -92,4 +110,4 @@ tests:
value: "/usr/sbinx"
- equal:
path: spec.template.spec.initContainers[*].volumeMounts[?(@.name=="config")].mountPath
value: "/usr/sbinx"
value: "/usr/sbinx"