You've already forked helm-gitea
fix(deployment): remove deployment.labels from selector.matchLabels (#1011)
This PR removes the inclusion of `deployment.labels` in the Deployment's `selector.matchLabels` field. ## Changes - Removed the conditional block that adds `deployment.labels` to `selector.matchLabels` - This ensures the selector remains immutable and only contains pod-identifying labels Reviewed-on: https://gitea.com/gitea/helm-gitea/pulls/1011 Reviewed-by: Markus Pesch <volker.raschek@noreply.gitea.com> Co-authored-by: Tarun Gaba <tarun.gaba7@gmail.com> Co-committed-by: Tarun Gaba <tarun.gaba7@gmail.com>
This commit is contained in:
@@ -24,9 +24,6 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||||
{{- if .Values.deployment.labels }}
|
|
||||||
{{- toYaml .Values.deployment.labels | nindent 6 }}
|
|
||||||
{{- end }}
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
@@ -29,6 +29,22 @@ tests:
|
|||||||
path: spec.template.metadata.labels
|
path: spec.template.metadata.labels
|
||||||
content:
|
content:
|
||||||
hello: world
|
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
|
- it: nodeSelector is undefined
|
||||||
asserts:
|
asserts:
|
||||||
- notExists:
|
- notExists:
|
||||||
|
|||||||
Reference in New Issue
Block a user