Kubernetes: kubectl wait with selectors does not output anything if resource is not found

Created on 20 Jul 2018  ·  3Comments  ·  Source: kubernetes/kubernetes

Is this a BUG REPORT or FEATURE REQUEST?:

/kind bug

What happened:

When running the command without selectors, everything seems to work:

kubectl wait deployment/web --for condition=available --timeout=100s

It waits until the condition is met, and then outputs:

deployment.extensions/web condition met

Or, if it can't find a resource, it outputs:

Error from server (NotFound): deployment.extensions "web" not found.

Which is expected and a useful output.

However, when using selectors, if nothing is matched, it simply returns and does not output anything. For example, if I have a deployment with app=http-server, using selectors still works:

kubectl wait deployment -l app=http-server --for condiiton=available --timeout=100s

Output:

deployment.extensions/http-server condition met

However, with an invalid selector, it just returns without saying anything was found:

kubectl wait deployment -l app=http-server2 --for condiiton=available --timeout=100s

(No output from terminal, instant return). It would be much more useful to mimic the behavior when not using a selector, to say that a resource was not found.

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTreeState:"clean", BuildDate:"2018-04-27T09:22:21Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.5", GitCommit:"32ac1c9073b132b8ba18aa830f46b77dcceb0723", GitTreeState:"clean", BuildDate:"2018-06-21T11:34:22Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

  • Cloud provider or hardware configuration: Azure
kinbug sicli

Most helpful comment

@m1kola Congrats on your first PR to k8s! I appreciate the quick turnaround on that!

All 3 comments

/sig cli

I'm going to work on this. I don't know kubernetes source code very well, so, probably, it will take some time.

@m1kola Congrats on your first PR to k8s! I appreciate the quick turnaround on that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chowyu08 picture chowyu08  ·  3Comments

Seb-Solon picture Seb-Solon  ·  3Comments

pwittrock picture pwittrock  ·  3Comments

zetaab picture zetaab  ·  3Comments

sjenning picture sjenning  ·  3Comments