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

allow output patch string in edit command #46091

Merged
merged 1 commit into from
Jul 17, 2017

Conversation

xilabao
Copy link
Contributor

@xilabao xilabao commented May 19, 2017

What this PR does / why we need it:
allow user to get the patch from edit command if user is not familiar with the patch format.

# ./cluster/kubectl.sh create role a --verb=get,list --resource=no
role "a" created

# ./cluster/kubectl.sh edit role a --output-patch=true
Patch: {"rules":[{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","delete"]}]}
role "a" edited

# ./cluster/kubectl.sh create role b --verb=get,list --resource=no
role "b" created

# ./cluster/kubectl.sh patch role b -p '{"rules":[{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","delete"]}]}'
role "b" patched

Which issue this PR fixes: fixes #47173

Special notes for your reviewer:

Release note:

Could get the patch from kubectl edit command

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 19, 2017
@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-none Denotes a PR that doesn't merit a release note. labels May 19, 2017
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 19, 2017
@eparis
Copy link
Contributor

eparis commented May 19, 2017

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 19, 2017
@xilabao
Copy link
Contributor Author

xilabao commented May 22, 2017

@k8s-bot kops aws e2e test this

@eparis
Copy link
Contributor

eparis commented May 22, 2017

what about _tests ?

@xilabao xilabao force-pushed the new-output-in-edit branch from e58ce3d to d467879 Compare May 23, 2017 01:32
@xilabao
Copy link
Contributor Author

xilabao commented May 23, 2017

@k8s-bot pull-kubernetes-federation-e2e-gce test this

@xilabao
Copy link
Contributor Author

xilabao commented May 23, 2017

test added. @eparis PTAL

@xilabao
Copy link
Contributor Author

xilabao commented May 25, 2017

@k8s-bot pull-kubernetes-federation-e2e-gce test this

@xilabao
Copy link
Contributor Author

xilabao commented May 25, 2017

@k8s-bot kops aws e2e test this
@k8s-bot pull-kubernetes-federation-e2e-gce test this

@xilabao
Copy link
Contributor Author

xilabao commented May 26, 2017

@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

@xilabao
Copy link
Contributor Author

xilabao commented May 26, 2017

@k8s-bot pull-kubernetes-federation-e2e-gce test this

1 similar comment
@fabianofranz
Copy link
Contributor

@k8s-bot pull-kubernetes-federation-e2e-gce test this

@derekwaynecarr derekwaynecarr removed their assignment May 31, 2017
@xilabao
Copy link
Contributor Author

xilabao commented Jun 1, 2017

@eparis @fabianofranz kindly ping

@eparis
Copy link
Contributor

eparis commented Jun 1, 2017

I still don't see any tests to show it is working...

@xilabao
Copy link
Contributor Author

xilabao commented Jun 1, 2017

I add it in the hack/make-rules/test-cmd-util.sh. Do you mean I should add a unit test for this?

@xilabao xilabao force-pushed the new-output-in-edit branch from d467879 to 08c6a53 Compare June 1, 2017 04:08
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 1, 2017
@xilabao
Copy link
Contributor Author

xilabao commented Jun 1, 2017

@k8s-bot kops aws e2e test this
@k8s-bot pull-kubernetes-federation-e2e-gce test this
@k8s-bot pull-kubernetes-unit test this
@k8s-bot pull-kubernetes-verify test this
@k8s-bot pull-kubernetes-e2e-kops-aws test this

@xilabao xilabao force-pushed the new-output-in-edit branch from 08c6a53 to 29e2bd9 Compare June 1, 2017 06:29
@xilabao xilabao force-pushed the new-output-in-edit branch from 29e2bd9 to fe4afa8 Compare June 1, 2017 06:59
@xilabao
Copy link
Contributor Author

xilabao commented Jun 1, 2017

@k8s-bot pull-kubernetes-node-e2e test this
@k8s-bot pull-kubernetes-federation-e2e-gce test this
@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2017
@eparis
Copy link
Contributor

eparis commented Jun 1, 2017

Actually I removed my lgtm, @fabiand do you like --output-patch=true or should we do something like -o patch ? I'll let you do the LGTM

@eparis eparis removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2017
@xilabao
Copy link
Contributor Author

xilabao commented Jun 2, 2017

Let me just explain, the patch is output to stdout, but -o yaml|json is output to the edited file. so I use --output-patch instead of -o patch.

Need your knowledge and experience, thanks! @fabianofranz @eparis

@fabiand
Copy link
Contributor

fabiand commented Jun 2, 2017

Even if I'm not @fabianofranz I do see the point of @xilabao and would also take --output-patch as it signals a post operation, and not the patch format.

@xilabao
Copy link
Contributor Author

xilabao commented Jun 6, 2017

Thanks for your opinion. @fabiand.
I'm not sure what we want now. any suggestion? thx @fabianofranz @eparis

@fabianofranz
Copy link
Contributor

I agree with @xilabao argument,
/lgtm
/approve
/release-note
@xilabao needs the link to an issue and I'd suggest adding a release note.

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jun 7, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fabianofranz, xilabao

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

The full list of commands accepted by this bot can be found here.

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 Jun 8, 2017
@xilabao
Copy link
Contributor Author

xilabao commented Jun 8, 2017

@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

2 similar comments
@fabianofranz
Copy link
Contributor

@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

@xilabao
Copy link
Contributor Author

xilabao commented Jun 12, 2017

@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

@fejta
Copy link
Contributor

fejta commented Jul 15, 2017

/retest

2 similar comments
@fejta
Copy link
Contributor

fejta commented Jul 16, 2017

/retest

@fejta
Copy link
Contributor

fejta commented Jul 16, 2017

/retest

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 17, 2017

@xilabao: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
Jenkins kops AWS e2e e58ce3d29eb097718c009e9a066ded182fb3fee8 link @k8s-bot kops aws e2e test this
pull-kubernetes-federation-e2e-gce fe4afa8 link /test pull-kubernetes-federation-e2e-gce

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

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 46091, 48280)

@k8s-github-robot k8s-github-robot merged commit 8ce6378 into kubernetes:master Jul 17, 2017
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 Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get the patch from edit command
8 participants