You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
kubectl delete doesn't return error or print resource not found #8218
If you run kubectl delete resource <non_existent_resource_name>, kubectl exits with 0 and prints nothing.
E.g.
$ ./cluster/kubectl.sh delete pod abc
$ echo $?
0
I expected to see a "resource not found" message and/or an error code when this occurred. It's very misleading when you type the wrong resource name and think you delete it.
I'm with @yujuhong on this; it should both print an error and exit nonzero, at least by default. I'm happy to add a --ignore-not-found flag for users who want 404s to be silent.
I'm happy to add a --ignore-not-found flag for users who want 404s to be silent.
I don't care about it that much :)
Just that if i was scripting some cron like thing to delete periodically I would like an event or email or some such if deletion failed, but not if the thing is already deleted. I suppose one could always regex the error message or examine the error code.
Activity
liggitt commentedon May 14, 2015
+1
yujuhong commentedon May 15, 2015
/cc @jlowdermilk, @brendanburns
bprashanth commentedon May 15, 2015
Personally i would prefer an fprintf and no error on 404 for delete
j3ffml commentedon May 15, 2015
I'm with @yujuhong on this; it should both print an error and exit nonzero, at least by default. I'm happy to add a
--ignore-not-foundflag for users who want 404s to be silent.bprashanth commentedon May 15, 2015
I don't care about it that much :)
Just that if i was scripting some cron like thing to delete periodically I would like an event or email or some such if deletion failed, but not if the thing is already deleted. I suppose one could always regex the error message or examine the error code.