You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/04 23:29:40 UTC

[GitHub] [airflow] jedcunningham commented on a change in pull request #19398: Decouple name randomization from name kwarg

jedcunningham commented on a change in pull request #19398:
URL: https://github.com/apache/airflow/pull/19398#discussion_r743270704



##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -484,6 +489,11 @@ def create_pod_request_obj(self) -> k8s.V1Pod:
             ),
         )
 
+        if self.random_name_suffix:
+            if pod_template:
+                pod_template.metadata.name = PodGenerator.make_unique_pod_id(pod_template.metadata.name)
+            pod.metadata.name = PodGenerator.make_unique_pod_id(pod.metadata.name)
+
         pod = PodGenerator.reconcile_pods(pod_template, pod)

Review comment:
       ```suggestion
           pod = PodGenerator.reconcile_pods(pod_template, pod)
           
           if self.random_name_suffix:
               pod.metadata.name = PodGenerator.make_unique_pod_id(pod.metadata.name)
   ```
   
   Can we randomize after we reconcile the pod?




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org