kubernetes-sigs / kubernetes-sigs/cli-utils
[Bug]: pkg/object/ParseObjMetadata incorrectly assumes rbac resource cannot have underscore in its name
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 178
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
If a clusterrole / binding has an underscore in its name (e.g roles_ops which is valid in kubernetes), Using the ParseObjMetadata function failes with
too many fields within:
This can be resolved by replacing the underscore with a double underscore (like it is here done for colon) or removing the check for underscores in the function.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/object/objmetadata.go at ParseObjMetadata and reproduce the failure with a clusterrole or binding named roles_ops. Compare the underscore handling with the colon handling near line 139, then run the relevant package tests. Done means metadata with underscores parses without the “too many fields” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100