Skip to content
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

use StringArray in create rolebindings #43903

Merged

Conversation

xilabao
Copy link
Contributor

@xilabao xilabao commented Mar 31, 2017

@liggitt I think maybe you like this.

`kubectl create rolebinding` and `kubectl create clusterrolebinding` no longer allow specifying multiple subjects as comma-separated arguments. Use repeated `--user`, `--group`, or `--serviceaccount` arguments to specify multiple subjects. 

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 31, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Hi @xilabao. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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/test-infra repository. I understand the commands that are listed here.

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Mar 31, 2017
@liggitt
Copy link
Member

liggitt commented Mar 31, 2017

@k8s-bot ok to test

@liggitt
Copy link
Member

liggitt commented Mar 31, 2017

I do like it.

cc @kubernetes/sig-cli-pr-reviews

@kubernetes/sig-cli-misc we should add this to the conventions/code review guidelines. Any value that could possibly contain a comma should use StringArray, not StringSlice

@liggitt liggitt added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 31, 2017
@liggitt
Copy link
Member

liggitt commented Mar 31, 2017

Can you sweep docs to make sure all examples use the repeated flag forms? Thanks.

@eparis
Copy link
Contributor

eparis commented Apr 3, 2017

Do we care this can/will break things that work today?

@liggitt
Copy link
Member

liggitt commented Apr 3, 2017

I do care, but given the youth of the commands, and that all the examples I could find used repetition, and that this is required to have any reasonable way to express bindings for user or group names with commas, I think it's worth it

@xilabao
Copy link
Contributor Author

xilabao commented Apr 3, 2017

I confirm that the examples of rolebinding are correct.

@liggitt
Copy link
Member

liggitt commented Apr 3, 2017

@k8s-bot ok to test
LGTM

cmd.Flags().StringSlice("serviceaccount", []string{}, "service accounts to bind to the role")
cmd.Flags().StringArray("user", []string{}, "usernames to bind to the role")
cmd.Flags().StringArray("group", []string{}, "groups to bind to the role")
cmd.Flags().StringArray("serviceaccount", []string{}, "service accounts to bind to the role")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while, you're touching this, add the expected format to the flag help (service accounts to bind to the role, in the format <namespace>:<name>)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mengqiy
Copy link
Member

mengqiy commented Apr 4, 2017

@k8s-bot gci gce e2e test this

@xilabao xilabao force-pushed the use-StringArray-for-user branch from 9a99173 to 33e5597 Compare April 5, 2017 10:45
@liggitt
Copy link
Member

liggitt commented Apr 5, 2017

/assign /lgtm

@grodrigues3 grodrigues3 added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 5, 2017
@mengqiy
Copy link
Member

mengqiy commented Apr 5, 2017

/lgtm
/assign @liggitt

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 5, 2017
@liggitt
Copy link
Member

liggitt commented Apr 5, 2017

/approve

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, xilabao, ymqytw

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 5, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 44104, 43903, 44109)

@k8s-github-robot k8s-github-robot merged commit 3160d72 into kubernetes:master Apr 6, 2017
k8s-github-robot pushed a commit that referenced this pull request May 15, 2017
…eName

Automatic merge from submit-queue

use StringArrayVar for ResourceName

ref to #43903

```release-note
`kubectl create role` and `kubectl create clusterrole` no longer allow specifying multiple resource names as comma-separated arguments. Use repeated `--resource-name` arguments to specify multiple resource names. 
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants