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


##########
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:
   This file is totally not aligned with how tests are written in the Helm 
Chart area. Could you adjust it?



##########
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:
   Most of the changes in this file seem unrelated.



##########
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:
   Kubernetes has a couple more recommended labels like 
`app.kubernetes.io/version`, `app.kubernetes.io/instance` and 
`app.kubernetes.io/name` which we could use too.



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

Review Comment:
   It is rather unnecessary. We could delete it.



-- 
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