Skip to content

Commit

Permalink
add pod status wait instead of sleeps
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Bugwadia <[email protected]>
  • Loading branch information
JimBugwadia committed Aug 28, 2024
1 parent 54c76b2 commit 877d2ee
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 13 deletions.
10 changes: 10 additions & 0 deletions other/audit-event-on-exec/.chainsaw-test/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ spec:
file: ns.yaml
- apply:
file: pod.yaml
- wait:
apiVersion: v1
kind: Pod
name: execevent-pod
namespace: exec-event-ns
timeout: 1m
for:
condition:
name: Ready
value: 'true'
- name: step-03
try:
- sleep:
Expand Down
13 changes: 9 additions & 4 deletions other/refresh-env-var-in-pod/.chainsaw-test/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ spec:
try:
- apply:
file: deployment.yaml
- name: step-03
try:
- sleep:
duration: 5s
- wait:
apiVersion: v1
kind: Pod
namespace: refresh-env-var-ns
timeout: 1m
for:
condition:
name: Ready
value: 'true'
- script:
content: |
kubectl get pod -n refresh-env-var-ns --no-headers | awk '{print $1}' > deploy-names.txt
Expand Down
6 changes: 3 additions & 3 deletions other/refresh-env-var-in-pod/.chainsaw-test/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
app: busybox
spec:
containers:
- image: busybox:1.35
- image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
command: ["sleep", "3600"]
env:
Expand Down Expand Up @@ -46,7 +46,7 @@ spec:
app: busybox
spec:
containers:
- image: busybox:1.35
- image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
command: ["sleep", "3600"]
env:
Expand Down Expand Up @@ -76,7 +76,7 @@ spec:
app: busybox
spec:
containers:
- image: busybox:1.35
- image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
command: ["sleep", "3600"]
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
- command:
- sleep
- "3600"
image: busybox:1.35
image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
volumeMounts:
- mountPath: /mnt/foo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
- command:
- sleep
- "3600"
image: busybox:1.35
image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
volumeMounts:
- mountPath: /mnt/foo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ spec:
- command:
- sleep
- "3600"
image: busybox:1.35
image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
- command:
- sleep
- "3600"
image: busybox:1.35
image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
volumeMounts:
- mountPath: /mnt/foo
Expand Down
11 changes: 9 additions & 2 deletions other/refresh-volumes-in-pods/.chainsaw-test/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ spec:
file: chainsaw-step-03-apply-2.yaml
- name: step-04
try:
- sleep:
duration: 5s
- wait:
apiVersion: v1
kind: Pod
namespace: refresh-vols-ns
timeout: 1m
for:
condition:
name: Ready
value: 'true'
- script:
content: |
annotation=$(kubectl get pod pod01 -n refresh-vols-ns -o json | kyverno jp query "metadata.annotations.\"corp.org/random\" || '' " | tail -n 1 | cut -d '"' -f 2)
Expand Down

0 comments on commit 877d2ee

Please sign in to comment.