-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fix: Ignore extra underscored when Object is an RBAC object in objmetadata #645
base: master
Are you sure you want to change the base?
Conversation
The committers listed above are authorized under a signed CLA. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liamchenoweth The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @liamchenoweth! |
Hi @liamchenoweth. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/assign @karlkfi |
/assign @mortent |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
This seems like it might break the ObjMetadata string format which uses underscores as segment delimiters and double underscores as colons. With this change, an RBAC object with double underscores wouldn't make it through a format+parse cycle. Maybe that's an acceptable limitation in order to support single underscores in RBAC names? I'm not really sure why underscores were originally chosen. It seems like backslashes would have been a better choice, like we used for the depends-on and apply-time-mutation annotations. Changing the ID format might be possible, but would probably require migration. And it might prohibit downgrades unless we shipped bi-directional migration beforehand, or made it an opt-in feature for a while. |
/ok-to-test |
@@ -102,6 +102,30 @@ func TestParseObjMetadata(t *testing.T) { | |||
inventory: &ObjMetadata{}, | |||
isError: true, | |||
}, | |||
"RBAC with underscores": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestParseObjMetadata only tests parsing, unfortunately, not round-trip format+parse. I think this change would break the round-trip.
@liamchenoweth: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Ref. #487
Skips the test for extra underscores when we are dealing with RBAC objects as they are only restricted to path objects for naming. Included new tests for this new use case