kaxil commented on a change in pull request #6621: [AIRFLOW-6025] Add label to 
uniquely identify creator of Pod
URL: https://github.com/apache/airflow/pull/6621#discussion_r349236097
 
 

 ##########
 File path: airflow/contrib/operators/kubernetes_pod_operator.py
 ##########
 @@ -127,6 +128,15 @@ def execute(self, context):
                                                  
cluster_context=self.cluster_context,
                                                  config_file=self.config_file)
 
+            # Add Airflow Version to the label
+            # And a label to identify that pod is launched by 
KubernetesPodOperator
+            self.labels.update(
+                {
+                    'airflow_version': airflow_version.replace('+', '-'),
 
 Review comment:
   Re. labels vs annotations:
   
   >You can use either labels or annotations to attach metadata to Kubernetes 
objects. Labels can be used to select objects and to find collections of 
objects that satisfy certain conditions. In contrast, annotations are not used 
to identify and select objects. The metadata in an annotation can be small or 
large, structured or unstructured, and can include characters not permitted by 
labels.
   So labels make more sense for e.g to select all the pods that are created by 
Kube Pod Operator

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to