kubernetes-sigs / kubernetes-sigs/cli-utils

[Bug]: pkg/object/ParseObjMetadata incorrectly assumes rbac resource cannot have underscore in its name

Open
#487 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lifecycle/frozen
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.