mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-30 19:34:43 +00:00
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 <goneri@lebouder.net> Reviewed-by: Mike Graves <mgraves@redhat.com> Reviewed-by: Bikouo Aubin
This commit is contained in:
70
tests/integration/targets/k8s_delete/files/deployments.yaml
Normal file
70
tests/integration/targets/k8s_delete/files/deployments.yaml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user