uranusjr commented on a change in pull request #19036:
URL: https://github.com/apache/airflow/pull/19036#discussion_r730569637
##########
File path: airflow/kubernetes/pod_generator.py
##########
@@ -460,9 +460,9 @@ def make_unique_pod_id(pod_id: str) -> str:
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('-.')
+ trimmed_pod_id = pod_id[:MAX_LABEL_LEN-len(safe_uuid)].rstrip('-.')
Review comment:
Please also update the comment above to explain the logic. It's also
probably better to split this into two lines
```suggestion
label_prefix_length = MAX_LABEL_LEN - len(safe_uuid)
trimmed_pod_id = pod_id[:label_prefix_length].rstrip('-.')
```
Because you probably won't like how Black formats this in a single line 🙂
--
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]