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/04/20 00:41:33 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #15443: Bugfix: Invalid name when trimmed `pod_id` ends with hyphen in ``Kube…

kaxil commented on a change in pull request #15443:
URL: https://github.com/apache/airflow/pull/15443#discussion_r616265823



##########
File path: airflow/kubernetes/pod_generator.py
##########
@@ -469,7 +469,10 @@ def make_unique_pod_id(pod_id: str) -> str:
 
         safe_uuid = uuid.uuid4().hex  # safe uuid will always be less than 63 chars
         trimmed_pod_id = pod_id[:MAX_LABEL_LEN]
-        safe_pod_id = f"{trimmed_pod_id}.{safe_uuid}"
+
+        # Since we use '.' as separator we need to remove all the occurences of '-' if any
+        # in the trimmed_pod_id as the regex does not allow '-' followed by '.'.
+        safe_pod_id = f"{trimmed_pod_id.rstrip('-')}.{safe_uuid}"

Review comment:
       Created https://github.com/apache/airflow/pull/15445 to address it




-- 
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:
users@infra.apache.org