kubernetes: kubectl wait should not fail if resource isn't available or is already deleted

Hi. A similar issue was reported here: https://github.com/kubernetes/kubernetes/issues/71420 but the bot had closed it due to inactivity. So, creating a new one with details again.

I am facing the same problem on my end. If a resource does not exist or is deleted, but you are using wait --for condition delete, it fails. There is a flag in delete --ignore-not-found=true to avoid such errors. A similar condition of flag must be added in kubectl wait as well so that it does not fail with errors like below.

 $ kubectl delete jobs/job1 --ignore-not-found=true
 job.batch "job1" deleted
 $ kubectl wait jobs/job1 --for=delete
 Error from server (NotFound): jobs.batch "job1" not found

Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 17
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Yes, this would be nice to have.