File tree Expand file tree Collapse file tree 3 files changed +76
-0
lines changed
other/mount-volumes-for-ephemeral-containers/.chainsaw-test Expand file tree Collapse file tree 3 files changed +76
-0
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : chainsaw.kyverno.io/v1alpha1
2+ kind : Test
3+ metadata :
4+ creationTimestamp : null
5+ name : mount-volumes-for-ephemeral-containers
6+ spec :
7+ timeouts :
8+ cleanup : 60s
9+ steps :
10+ - name : step-01
11+ try :
12+ - apply :
13+ file : ../mount-volumes-for-ephemeral-containers.yaml
14+ - assert :
15+ file : policy-ready.yaml
16+ - name : step-02
17+ try :
18+ - apply :
19+ file : pods.yaml
20+ - assert :
21+ resource :
22+ apiVersion : v1
23+ kind : Pod
24+ metadata :
25+ name : pod1
26+ namespace : default
27+ labels :
28+ ephemeral-debug : " true"
29+ spec :
30+ (volumes[?name == 'ephemeralcontainer-tmp-tcpdump-volume']) :
31+ - emptyDir :
32+ sizeLimit : 1G
33+ - name : step-03
34+ try :
35+ - script :
36+ content : kubectl debug -it pod1 --image=busybox:1.35 --target=busybox --attach=false -c pod1-dbg
37+ - name : step-04
38+ try :
39+ - assert :
40+ resource :
41+ apiVersion : v1
42+ kind : Pod
43+ metadata :
44+ name : pod1
45+ namespace : default
46+ labels :
47+ ephemeral-debug : " true"
48+ spec :
49+ ephemeralContainers :
50+ - name : pod1-dbg
51+ securityContext :
52+ readOnlyRootFilesystem : true
53+ volumeMounts :
54+ - mountPath : /tmp
55+ name : ephemeralcontainer-tmp-tcpdump-volume
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Pod
3+ metadata :
4+ name : pod1
5+ namespace : default
6+ labels :
7+ ephemeral-debug : " true"
8+ spec :
9+ containers :
10+ - name : busybox
11+ image : busybox:1.35
12+ command : ["sh", "-c", "while true; do sleep 3600; done"]
Original file line number Diff line number Diff line change 1+ apiVersion : kyverno.io/v1
2+ kind : ClusterPolicy
3+ metadata :
4+ name : mount-volumes-for-ephemeral-containers
5+ status :
6+ conditions :
7+ - reason : Succeeded
8+ status : " True"
9+ type : Ready
You can’t perform that action at this time.
0 commit comments