diff --git a/templates/gitea/deployment.yaml b/templates/gitea/deployment.yaml index 7da7d29..8871323 100644 --- a/templates/gitea/deployment.yaml +++ b/templates/gitea/deployment.yaml @@ -24,9 +24,6 @@ spec: selector: matchLabels: {{- include "gitea.selectorLabels" . | nindent 6 }} - {{- if .Values.deployment.labels }} - {{- toYaml .Values.deployment.labels | nindent 6 }} - {{- end }} template: metadata: annotations: diff --git a/unittests/helm/deployment/basic.yaml b/unittests/helm/deployment/basic.yaml index 1c81294..003cf2e 100644 --- a/unittests/helm/deployment/basic.yaml +++ b/unittests/helm/deployment/basic.yaml @@ -29,6 +29,22 @@ tests: path: spec.template.metadata.labels content: hello: world + - isNotSubset: + path: spec.selector.matchLabels + content: + hello: world + - it: deployment labels are not in selector matchLabels + template: templates/gitea/deployment.yaml + set: + deployment.labels: + custom-label: custom-value + another-label: another-value + asserts: + - equal: + path: spec.selector.matchLabels + value: + app.kubernetes.io/name: gitea + app.kubernetes.io/instance: gitea-unittests - it: nodeSelector is undefined asserts: - notExists: