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/08/03 14:53:08 UTC

[GitHub] [airflow] wyattshapiro commented on a change in pull request #16980: Change pod id notation back to hyphen

wyattshapiro commented on a change in pull request #16980:
URL: https://github.com/apache/airflow/pull/16980#discussion_r681837507



##########
File path: airflow/kubernetes/pod_generator.py
##########
@@ -453,7 +453,7 @@ def make_unique_pod_id(pod_id: str) -> str:
         # Strip trailing '-' and '.' as they can't be followed by '.'
         trimmed_pod_id = pod_id[:MAX_LABEL_LEN].rstrip('-.')
 
-        safe_pod_id = f"{trimmed_pod_id}.{safe_uuid}"
+        safe_pod_id = f"{trimmed_pod_id}-{safe_uuid}"

Review comment:
       In the case that the pod_id is long enough, then there will be an error even with the trimming introduced to prevent this  errorfrom occurring. This is because the safe_pod_id name appends the safe_uuid after trimming, which would make the returned label greater than the allowable label length MAX_LABEL_LEN.
   
   Should the trimming occur after the safe pod id is constructed?

##########
File path: airflow/kubernetes/pod_generator.py
##########
@@ -453,7 +453,7 @@ def make_unique_pod_id(pod_id: str) -> str:
         # Strip trailing '-' and '.' as they can't be followed by '.'
         trimmed_pod_id = pod_id[:MAX_LABEL_LEN].rstrip('-.')
 
-        safe_pod_id = f"{trimmed_pod_id}.{safe_uuid}"
+        safe_pod_id = f"{trimmed_pod_id}-{safe_uuid}"

Review comment:
       In the case that the pod_id is long enough, then there will be an error even with the trimming introduced to prevent this  error from occurring. This is because the safe_pod_id name appends the safe_uuid after trimming, which would make the returned label greater than the allowable label length MAX_LABEL_LEN.
   
   Should the trimming occur after the safe pod id is constructed?




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