kubernetes.core icon indicating copy to clipboard operation
kubernetes.core copied to clipboard

Make name optional indicating all objects

Open anon-software opened this issue 3 years ago • 2 comments

SUMMARY

Currently kubernetes.core.k8s requires either "name" or "label_selector" to be specified. I want to be able to run an operation on all objects.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

kubernetes.core.k8s

ADDITIONAL INFORMATION

Effectively, I am proposing an equivalent to kubectl --all option. For example, I would like to be able to delete all pods like this:

- name: Delete all pods
  kubernetes.core.k8s:
    kind: Pod
    namespace: mynamespace
    state: absent

anon-software avatar Aug 23 '22 16:08 anon-software

Thanks for your input @anon-software.

I get the desire for batch (all) operations, but this, as proposed, is too dangerous. If someone forgets to set the name they'd inadvertently wiping out everything. This "all" mode would need to be switched on explicitly to help avoid unintentional destruction of any resources.

tima avatar Aug 24 '22 16:08 tima

Yes, I see your point. An explicit flag will be equally functional and "safer", I do not mind having it that way.

anon-software avatar Aug 24 '22 17:08 anon-software