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

fix parse resource in setting selector #47719

Merged
merged 1 commit into from
Jul 12, 2017

Conversation

xilabao
Copy link
Contributor

@xilabao xilabao commented Jun 19, 2017

What this PR does / why we need it:

Which issue this PR fixes: fixes #47718

Special notes for your reviewer:

Release note:

Fix "kubectl set selector" failing due to not being able to parse the resource type

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 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.

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

@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 Jun 19, 2017
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Jun 19, 2017
@dims
Copy link
Member

dims commented Jun 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 Jun 19, 2017
@xilabao xilabao force-pushed the fix-set-selector-1 branch 2 times, most recently from 54dadd2 to 116a079 Compare June 20, 2017 02:00
@dims
Copy link
Member

dims commented Jun 20, 2017

/approve

@@ -116,6 +116,7 @@ func (o *SelectorOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
mapper, _ := f.Object()
o.mapper = mapper
o.encoder = f.JSONEncoder()
o.resources, o.selector, err = getResourcesAndSelector(args)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it return if err != nil here?

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. thanks!

@dims
Copy link
Member

dims commented Jul 1, 2017

/assign @deads2k

@dims
Copy link
Member

dims commented Jul 3, 2017

/unassign

@deads2k
Copy link
Contributor

deads2k commented Jul 3, 2017

@fabianofranz I think that @juanvallejo was in here recently, but I can't seem to choose him from the list

@juanvallejo
Copy link
Contributor

@deads2k will add my review, thanks

@@ -2440,7 +2440,7 @@ run_service_tests() {
# prove role=padawan
kube::test::get_object_assert 'services redis-master' "{{range$service_selector_field}}{{.}}:{{end}}" "padawan:"
# Set command to reset the selector back to the original one.
kubectl set selector -f examples/guestbook/redis-master-service.yaml app=redis,role=master,tier=backend
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's worth keeping this line, maybe also add a --local test?

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. PTAL @juanvallejo

@juanvallejo
Copy link
Contributor

One comment, otherwise this lgtm

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 7, 2017
@xilabao xilabao force-pushed the fix-set-selector-1 branch 3 times, most recently from 706ae3a to 0ba41e7 Compare July 7, 2017 02:43
@xilabao
Copy link
Contributor Author

xilabao commented Jul 7, 2017

/test pull-kubernetes-kubemark-e2e-gce

@deads2k
Copy link
Contributor

deads2k commented Jul 7, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, dims, xilabao

Associated issue: 47718

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

xilabao commented Jul 11, 2017

/test pull-kubernetes-kubemark-e2e-gce

@xilabao
Copy link
Contributor Author

xilabao commented Jul 12, 2017

/test pull-kubernetes-unit
/test pull-kubernetes-federation-e2e-gce
/test pull-kubernetes-e2e-kops-aws

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 48196, 42783, 48507, 47719, 46138)

@k8s-github-robot k8s-github-robot merged commit b07581e into kubernetes:master Jul 12, 2017
@k8s-github-robot
Copy link

@xilabao PR needs rebase

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 12, 2017
@wojtek-t wojtek-t modified the milestones: v1.8, v1.7 Jul 18, 2017
@wojtek-t wojtek-t added cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. cherrypick-candidate labels Jul 18, 2017
k8s-github-robot pushed a commit that referenced this pull request Jul 18, 2017
…9-upstream-release-1.7

Automatic merge from submit-queue

Automated cherry pick of #47719

Cherry pick of #47719 on release-1.7.

#47719: fix parse resource in setting selector
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.7" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

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. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. 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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. 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.

kubectl set selector failed