Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Relying on undefined behavior - parsing kubernetes resource names #342

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

Relying on undefined behavior - parsing kubernetes resource names #342

thockin opened this issue Mar 10, 2023 · 0 comments

Comments

@thockin
Copy link

thockin commented Mar 10, 2023

There appears to be a bug at https://github.com/weaveworks/wksctl/blob/master/pkg/cluster/machine/machines_manifest_test.go#L46

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.

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

No branches or pull requests

1 participant