uranusjr commented on a change in pull request #19036:
URL: https://github.com/apache/airflow/pull/19036#discussion_r732916655



##########
File path: airflow/kubernetes/pod_generator.py
##########
@@ -459,10 +459,14 @@ def make_unique_pod_id(pod_id: str) -> str:
             return None
 
         safe_uuid = uuid.uuid4().hex  # safe uuid will always be less than 63 
chars
-        # 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}"
+        # Get prefix length after subtracting the uuid length. Clean up . and 
- from
+        # end of podID because they can't be followed by '.'
+        label_prefix_length = MAX_LABEL_LEN - len(safe_uuid) - 1 # -1 for 
seperator

Review comment:
       ```suggestion
           label_prefix_length = MAX_LABEL_LEN - len(safe_uuid) - 1 # -1 for 
separator
   ```




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