diff --git a/other/rec-req/refresh-volumes-in-pods/04-check.yaml b/other/rec-req/refresh-volumes-in-pods/04-check-annotations.yaml similarity index 67% rename from other/rec-req/refresh-volumes-in-pods/04-check.yaml rename to other/rec-req/refresh-volumes-in-pods/04-check-annotations.yaml index eee1fc1a0..e5ec918e0 100644 --- a/other/rec-req/refresh-volumes-in-pods/04-check.yaml +++ b/other/rec-req/refresh-volumes-in-pods/04-check-annotations.yaml @@ -13,14 +13,4 @@ commands: if [ "$annotation" = "1234abcd" ]; then exit 0; else exit 1; fi - script: | annotation=$(kubectl get pod pod04 -n refresh-vols-ns -o json | kyverno jp query "metadata.annotations.\"corp.org/random\" || '' " | tail -n 1 | cut -d '"' -f 2) - if [ "$annotation" = "1234abcd" ]; then exit 0; else exit 1; fi -- script: | - val=$(kubectl exec pod01 -n refresh-vols-ns -- cat /mnt/foo/foo) - if [ "$val" = "bar" ]; then exit 0; else exit 1; fi -- script: | - val=$(kubectl exec pod02 -n refresh-vols-ns -- cat /mnt/foo/foo) - if [ "$val" = "bar" ]; then exit 0; else exit 1; fi -- script: | - val=$(kubectl exec pod04 -n refresh-vols-ns -- cat /mnt/foo/foo) - if [ "$val" = "bar" ]; then exit 0; else exit 1; fi -- command: kubectl delete all --all --force --grace-period=0 -n refresh-vols-ns \ No newline at end of file + if [ "$annotation" = "1234abcd" ]; then exit 0; else exit 1; fi \ No newline at end of file diff --git a/other/rec-req/refresh-volumes-in-pods/05-check.yaml b/other/rec-req/refresh-volumes-in-pods/05-check.yaml new file mode 100644 index 000000000..536299327 --- /dev/null +++ b/other/rec-req/refresh-volumes-in-pods/05-check.yaml @@ -0,0 +1,14 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: +- command: sleep 3 +- script: | + val=$(kubectl exec pod01 -n refresh-vols-ns -- cat /mnt/foo/foo) + if [ "$val" = "bar" ]; then exit 0; else exit 1; fi +- script: | + val=$(kubectl exec pod02 -n refresh-vols-ns -- cat /mnt/foo/foo) + if [ "$val" = "bar" ]; then exit 0; else exit 1; fi +- script: | + val=$(kubectl exec pod04 -n refresh-vols-ns -- cat /mnt/foo/foo) + if [ "$val" = "bar" ]; then exit 0; else exit 1; fi +- command: kubectl delete all --all --force --grace-period=0 -n refresh-vols-ns \ No newline at end of file