Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chart/newsfragments/53190.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apply Dag processor-specific labels to its Deployment.
4 changes: 2 additions & 2 deletions chart/templates/dag-processor/dag-processor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ metadata:
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- if or .Values.labels .Values.dagProcessor.labels }}
{{- mustMerge .Values.dagProcessor.labels .Values.labels | toYaml | nindent 4 }}
{{- end }}
{{- if .Values.dagProcessor.annotations }}
annotations: {{- toYaml .Values.dagProcessor.annotations | nindent 4 }}
Expand Down
23 changes: 23 additions & 0 deletions chart/tests/helm_tests/dagprocessor/test_labels_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,29 @@ def test_should_add_component_specific_labels(self):
== "test_component_label_value"
)

def test_should_merge_global_and_component_specific_labels_in_deployment_metadata(self):
"""Test metadata.labels merge both global and component labels."""
docs = render_chart(
values={
"labels": {
"test_global_label": "test_global_label_value",
"common_label": "global_value",
},
"dagProcessor": {
"labels": {
"test_component_label": "test_component_label_value",
"common_label": "component_value",
},
},
},
show_only=[self.TEMPLATE_FILE],
)

labels = jmespath.search("metadata.labels", docs[0])
assert labels["test_global_label"] == "test_global_label_value"
assert labels["test_component_label"] == "test_component_label_value"
assert labels["common_label"] == "component_value"

def test_should_merge_global_and_component_specific_labels(self):
"""Test adding both .Values.labels and .Values.dagProcessor.labels."""
docs = render_chart(
Expand Down