generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make name optional to delete all resources for the specified resource…
… 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
- Loading branch information
Showing
11 changed files
with
235 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
minor_changes: | ||
- k8s - add new option delete_all to support deletion of all resources when state is set to absent. (https://github.com/ansible-collections/kubernetes.core/issues/504) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
tests/integration/targets/k8s_delete/files/deployments.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-d | ||
labels: | ||
context: ansible | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
context: ansible | ||
template: | ||
metadata: | ||
labels: | ||
context: ansible | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx | ||
ports: | ||
- containerPort: 80 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: openjdk-d | ||
labels: | ||
context: ansible | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
context: ansible | ||
template: | ||
metadata: | ||
labels: | ||
context: ansible | ||
spec: | ||
containers: | ||
- name: openjdk | ||
image: openjdk:17 | ||
command: | ||
- /bin/sh | ||
- -c | ||
- while true;do date;sleep 5; done | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: alpine-d | ||
labels: | ||
context: ansible | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
context: ansible | ||
template: | ||
metadata: | ||
labels: | ||
context: ansible | ||
spec: | ||
containers: | ||
- name: alpine | ||
image: alpine | ||
command: | ||
- /bin/sh | ||
- -c | ||
- while true;do date;sleep 5; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters