terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
BUG: Relying on undefined behavior - parsing kubernetes resource names
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.
Hi @thockin,
Thank you for pointing out this. We will take this into consideration in future releases.
Almost a year later this bug still exists. If kubernetes changes this behavior you will break.