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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]