mihirduvedi commented on code in PR #71987:
URL: https://github.com/apache/airflow/pull/71987#discussion_r4381961636


##########
chart/tests/helm_tests/airflow_aux/test_recommended_labels.py:
##########
@@ -0,0 +1,286 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   Removed the separate label test module and kept the assertions in the 
existing Helm tests. The expected application version now comes from 
`Chart.yaml` through a shared fixture.
   
   ---
   Drafted-by: Codex (GPT-6) (no human review before posting)
   



##########
chart/tests/helm_tests/airflow_aux/test_basic_helm_chart.py:
##########
@@ -292,6 +292,7 @@ def test_labels_are_valid(self, executor, 
flower_routing_values, flower_routing_
             (f"{release_name}-airflow-worker", "ServiceAccount", "worker"),

Review Comment:
   Reverted the unrelated resource-list changes. The changes in this test now 
cover the label migration and the chart-version assertion.
   
   ---
   Drafted-by: Codex (GPT-6) (no human review before posting)
   



##########
chart/templates/_helpers.yaml:
##########
@@ -37,6 +37,43 @@ If release name contains chart name it will be used as a 
full name.
   {{- end }}
 {{- end }}
 
+{{/*
+Sanitize a value for use as a Kubernetes label value.
+*/}}
+{{- define "airflow.labelValue" -}}
+  {{- . | toString | replace "+" "_" | trunc 63 | trimAll "-_." -}}
+{{- end }}
+
+{{/*
+Kubernetes recommended labels for chart resources.
+*/}}
+{{- define "airflow.standardLabels" -}}
+  {{- $root := .root -}}
+  {{- $labels := dict
+    "app.kubernetes.io/instance" (include "airflow.labelValue" 
$root.Release.Name)
+    "app.kubernetes.io/managed-by" (include "airflow.labelValue" 
$root.Release.Service)
+    "app.kubernetes.io/part-of" "airflow"

Review Comment:
   Added `app.kubernetes.io/name` and `app.kubernetes.io/version` to the 
resource and pod label helpers; `app.kubernetes.io/instance` uses the Helm 
release name. The corresponding legacy labels and selectors have been migrated.
   
   ---
   Drafted-by: Codex (GPT-6) (no human review before posting)
   



##########
chart/newsfragments/71987.feature.rst:
##########
@@ -0,0 +1 @@
+Add Kubernetes-recommended labels to chart-managed resources and pods

Review Comment:
   Removed the news fragment.
   
   ---
   Drafted-by: Codex (GPT-6) (no human review before posting)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to