Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make name optional indicating all objects #504

Closed
anon-software opened this issue Aug 23, 2022 · 2 comments · Fixed by #517
Closed

Make name optional indicating all objects #504

anon-software opened this issue Aug 23, 2022 · 2 comments · Fixed by #517
Assignees
Labels
jira type/enhancement New feature or request

Comments

@anon-software
Copy link

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
@tima
Copy link
Collaborator

tima commented Aug 24, 2022

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.

@anon-software
Copy link
Author

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

@gravesm gravesm added the type/enhancement New feature or request label Aug 30, 2022
@abikouo abikouo self-assigned this Sep 21, 2022
@abikouo abikouo added the jira label Sep 21, 2022
softwarefactory-project-zuul bot pushed a commit that referenced this issue Mar 23, 2023
… type (#517)

make name optional to delete all resources for the specified resource type

SUMMARY

closes #504
k8s module should allow deleting all namespace resources for the specified resource type.

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

k8s
ADDITIONAL INFORMATION


Delete all Pods from namespace test

- k8s:
    namespace: test
    kind: Pod
    api_version: v1
    delete_all: true
    state: absent

Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: Bikouo Aubin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira type/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants