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 kubectl -f to filter by selector #32599

Merged
merged 2 commits into from
Oct 1, 2016

Conversation

mikedanese
Copy link
Member

@mikedanese mikedanese commented Sep 13, 2016

cc @kubernetes/kubectl

Fixes #32544


This change is Reviewable

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Sep 13, 2016
@mikedanese mikedanese added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Sep 13, 2016
@k8s-bot
Copy link

k8s-bot commented Sep 15, 2016

GCE e2e build/test passed for commit 9e180fe.

@dgonzalez
Copy link

I would like to shadow this code review

@mikedanese
Copy link
Member Author

this is blocking #33698

@pwittrock
Copy link
Member

@ymqytw Would you shadow this as well?

@pwittrock
Copy link
Member

@janetkuo Let me know if you don't have bandwidth for this

@janetkuo
Copy link
Member

Please add a test for this, e.g. in hack/make-rules/test-cmd.sh

@mengqiy
Copy link
Member

mengqiy commented Sep 30, 2016

Looks good for now, but need rebase and a test.

@mikedanese
Copy link
Member Author

@ymqytw I rebased and added a test

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 30, 2016
@mengqiy
Copy link
Member

mengqiy commented Sep 30, 2016

Review status: 0 of 6 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


pkg/kubectl/resource/builder.go, line 713 at r2 (raw file):

      return &Result{err: fmt.Errorf("name cannot be provided when a selector is specified")}
  }

It should return a error, if len(b.resourceTuples) != 0, shouldn't it?


Comments from Reviewable

@mikedanese
Copy link
Member Author

@ymqytw Agree. fixed.

@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit 6339d91. Full PR test history.

The magic incantation to run this job again is @k8s-bot gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@mengqiy
Copy link
Member

mengqiy commented Sep 30, 2016

LGTM

@mikedanese
Copy link
Member Author

@k8s-bot e2e test this please, issue: #33672

@mikedanese mikedanese added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 30, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot k8s-github-robot merged commit 6f69293 into kubernetes:master Oct 1, 2016
@mikedanese mikedanese deleted the kubectl-selector branch October 1, 2016 17:45
@bgrant0607
Copy link
Member

@mikedanese Does this support filtering for all commands that support --filename?

@mikedanese
Copy link
Member Author

@bgrant0607 it adds infrastructure to but individual commands need to be slightly retrofitted.

k8s-github-robot pushed a commit that referenced this pull request Oct 7, 2016
Automatic merge from submit-queue

kubectl: implement kubectl apply --prune

Closes #19805

Depends on #32599 

@errordeveloper @lukemarsden
k8s-github-robot pushed a commit that referenced this pull request Jan 24, 2017
Automatic merge from submit-queue (batch tested with PRs 40328, 40057)

Allows kubectl create -f to filter by selector.

From #32544.

The underlying `seletor` infrastructrue was implemented by #32599. The test is basically copy-paste of the corresponding test for `kubectl apply -f -l`.

```release-note
kubectl create now accepts the label selector flag for filtering objects to create
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.