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



##########
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:
       Valid point, but we also can't trim the result name, since it might 
cause collisions. Since we ensure that trimmed_pod_id is limited, all we need 
to ensure is that uuid is limited too. Now, knowing that safe_uuid is static 
length, we can calculate the exact leftover space for trimmed_pod_id.
   
   In other words, if length is the initial problem of nearby ticket, I would 
go with something like:
   ```
   trimmed_pod_id = pod_id[:MAX_LABEL_LEN-len(safe_uuid)].rstrip('-.')
   ```




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