-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Change pod id notation back to hyphen #16980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
|
Could you please rebase to latest main? |
|
@dimon222, this effort is already underway in #16636. Maybe you could coordinate with @SimonOsipov to see if you can collaborate? |
|
Actually I think the final solution implemented in #17057 happens to also cover this? |
| 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}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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('-.')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like the right solution to me. Could you update the PR to use this?
A comment explaining why the various cleanups are needed would also be nice.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
|
Anything specific is required on this? |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
|
Closing in favor of better written #19036 |
closes: #16611
Affects - KubernetesPodOperator's pod id naming notation
Fix for various issues related to container's IP self-resolution in Kubernetes. Period is typically interpreted as current container is having some level domain instead of dummy hostname that cannot be resolved from outside.
Previously, the container already had hyphen in name, but now period caused regressions.
See #16611 for more clarification and exact line references.