mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Makes kubectl wait exit with status 1 and print an error message, if there is no resources matching selectors **What this PR does / why we need it**: It makes the `kubectl wait` command print an error message and exit with exit code 1, if there is no resource matching users's query. This can happen when user specifies selectors. Example: ``` kubectl wait deployment -l app=something-that-does-not-exist --for condition=available --timeout=5s ``` **Which issue(s) this PR fixes**: Fixes #66456 **Special notes for your reviewer**: This is my first contribution into the project (except one line change in docs) and don't have much experience with Go. I learned a lot while working on this (about resource finders and the `Visitor` interface and it's implementations), but it is very likely that I'm doing something wrong :) I'm keen to continue contributing into the project (into the cli part for now), so I will really appreciate detailed feedback, if you have a chance to provide it (point me into a right direction and/or explain why it's not a good idea to do something in a certain way). Thanks! **Release note**: ```release-note kubectl: the wait command now prints an error message and exits with the code 1, if there is no resources matching selectors ```