Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
template-processors/base/bin: don't try deleting ComponentStatus objects
This commit works around a problem mentioned in kubernetes/kubectl#151 (comment): > > For some reason when I add a label selector that should not match > > anything to the command [...], it returns 3 ComponentStatus items: > > > > $ kubectl get $(kubectl api-resources --verbs=list -o name | paste -sd, -) --ignore-not-found --all-namespaces -l random=label > > NAME AGE > > componentstatus/controller-manager <unknown> > > componentstatus/scheduler <unknown> > > componentstatus/etcd-0 <unknown> > > ComponentStatus is an unusual API with a custom list > implementation, and did not pay any attention to label selectors > until kubernetes/kubernetes#78438 fixed that in 1.17 As a result of the above issue, ComponentStatus items leak into `ownedKinds` and further into the attempted `kubectl delete` operation, where they tend to trigger an unnecessary error (because deleting them is forbidden). The ComponentStatus is a readonly "feature" of Kubernetes, so we won't ever expect to try and delete it purposefully anyway, see e.g.: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#componentstatus-v1-core Therefore, this commit filters out the ComponentStatus kind explicitly from the list of `ownedKinds` to consider for deletion.
- Loading branch information