I've started learning k8s and I noticed that in our organization they have a jenkins job to delete resources.
The job has this following code and runs as a shell.
kubectl delete -o name -f $file | grep deployment | xargs kubectl rollout status --namespace=${namespace}
But unfortunately , this delete job always is in failed state.
13:05:04 + kubectl delete -o name -f services/stg/applications/stg-x/foo-svc.yml
13:05:04 + grep deployment
13:05:04 + xargs kubectl rollout status --namespace=stg-x
13:05:04 Error from server (NotFound): deployments.extensions "stg-x-foo-svc" not found
13:05:04 Build step 'Execute shell' marked build as failure
13:05:17 Finished: FAILURE
Does this mean that we can't do a rollout status on a deleted deployment resource? or is entirely different issue? Looking for an effective solution that would help to check the status after a delete irrespective of what is being deleted.
Ps: This job is common for all resources, the developers just pass the file to delete particular resource. (replicasets,deployment,daemonsets,pods,stateful-sets)