Skip to content
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

BUG: Relying on undefined behavior - parsing kubernetes resource names #2037

Open
thockin opened this issue Mar 10, 2023 · 3 comments
Open

Comments

@thockin
Copy link

thockin commented Mar 10, 2023

https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/kubernetes/structures_pod.go#L50

The random suffix of a pod or other resource is not guaranteed to be 5 characters, nor is the characterset defined. Those are implementation details, not to be depended on. This is brittle and could change at any time.

You should be using labels to extract metadata, not parsing the name. That's literally why they exist.

@arybolovlev
Copy link
Contributor

Hi @thockin,

Thank you for pointing out this. We will take this into consideration in future releases.

@thockin
Copy link
Author

thockin commented Jan 14, 2024

Almost a year later this bug still exists. If kubernetes changes this behavior you will break.

@thockin
Copy link
Author

thockin commented Jan 13, 2025

Almost a year later this bug still exists. When kubernetes changes this behavior you will break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants