-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kubectl: don't display an empty list when trying to get a single resource that isn't found #28294
kubectl: don't display an empty list when trying to get a single resource that isn't found #28294
Conversation
Return immediately when attempting to get a singular resource that isn't found, so that we avoid printing out a List if the output format is something like json or yaml. Before: ``` $ kubectl get pod/foo -o yaml apiVersion: v1 items: [] kind: List metadata: {} pods "foo" not found ``` After: ``` $ kubectl get pod/foo -o yaml pods "foo" not found ```
This restores the v1.2 behavior (v1.3 changed it). I'm guessing this warrants a release note? |
Sorry @metral I didn't realize you had opened a fix for this already |
GCE e2e build/test passed for commit 67d929a. |
Jenkins verification failed b/c it was unable to install etcd. @k8s-bot test this issue: #IGNORE |
GCE e2e build/test failed for commit 67d929a. Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake. |
@k8s-bot e2e test this issue: #IGNORE |
GCE e2e build/test passed for commit 67d929a. |
Per @smarterclayton's advice above and in #28243 (comment), this PR should be used for the fix. I'll go ahead and close out the dup over at #28251 |
If this makes it in before 1.3.0 is cut, we don't need a release note. If it goes in 1.3.1, then we probably need one. |
@smarterclayton @erictune @bgrant0607 @janetkuo @goltermann bump for review & decision if this is 1.3.0 or 1.3.1. Thanks! |
This is not 1.3.0 On Jul 1, 2016 7:00 AM, "Andy Goldstein" notifications@github.com wrote:
|
Yes, agreed, and let's definitely release note it for 1.3.0. |
K, typing up a release note now. |
I updated the title of the PR and set the release-note label |
I tested it locally and it still gives me: $ kubectl get pod/abc -o yaml
apiVersion: v1
items: []
kind: List
metadata: {}
pods "abc" not found Would you confirm it? |
Testing now |
Weird, this worked when I wrote it... But I'm now seeing the same thing as you. Looking into it. |
Oh wait, I was running the wrong |
@ncdc ah-ha, yes, I was running the wrong |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 67d929a. |
Automatic merge from submit-queue |
@ncdc Cherrypick approved. Please create a cherrypick PR. Thanks. |
Commit found in the "release-1.3" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
…f-#28294-upstream-release-1.3 Automatic merge from submit-queue Automated cherry pick of kubernetes#28294 Cherry pick of kubernetes#28294 on release-1.3.
Return immediately when attempting to get a singular resource that isn't found, so that we avoid
printing out a List if the output format is something like json or yaml.
Before:
After:
Fixes #28243
@kubernetes/kubectl @kubernetes/rh-ux @smarterclayton @liggitt @deads2k @metral