diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2dfa017..cfc20ab 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -51,10 +51,10 @@ jobs: - name: Create StorageClass, test PVCs and PODs run: | - kubectl apply -f test/sc.yaml kubectl apply -f test/pvc-1.yaml kubectl apply -f test/pvc-2.yaml kubectl apply -f test/pod-1.yaml + kubectl apply -f test/pod-2.yaml - name: Install SSHFS run: sudo apt-get update && sudo apt-get install -y sshfs --no-install-recommends --no-install-suggests @@ -70,12 +70,11 @@ jobs: end=$((SECONDS+10)); while [[ $(kubectl get pvc pvc-1 -o 'jsonpath={..status.phase}') != "Bound" && SECONDS -lt $end ]]; do echo "waiting for pvc-1 status" && sleep 1; done end=$((SECONDS+10)); while [[ $(kubectl get pvc pvc-2 -o 'jsonpath={..status.phase}') != "Bound" && SECONDS -lt $end ]]; do echo "waiting for pvc-2 status" && sleep 1; done end=$((SECONDS+10)); while [[ $(kubectl get pod pod-1 -o 'jsonpath={.status.conditions[?(@.type=="Ready")].status}') != "True" && SECONDS -lt $end ]]; do echo "waiting for pod-1 status" && sleep 1; done + end=$((SECONDS+10)); while [[ $(kubectl get pod pod-2 -o 'jsonpath={.status.conditions[?(@.type=="Ready")].status}') != "True" && SECONDS -lt $end ]]; do echo "waiting for pod-2 status" && sleep 1; done kubectl describe pvc pvc-1 kubectl describe pvc pvc-2 kubectl describe pod pod-1 - kubectl get storageclass standard -o yaml - kubectl get storageclass test -o yaml - kubectl get nodes + kubectl describe pod pod-2 - name: Run tests run: | @@ -93,6 +92,7 @@ jobs: - name: Delete PODs and PVCs run: | kubectl delete -f test/pod-1.yaml + kubectl delete -f test/pod-2.yaml kubectl delete -f test/pvc-1.yaml kubectl delete -f test/pvc-2.yaml diff --git a/test/pod-1.yaml b/test/pod-1.yaml index bdf590c..81f5294 100644 --- a/test/pod-1.yaml +++ b/test/pod-1.yaml @@ -4,7 +4,7 @@ metadata: name: pod-1 spec: containers: - - name: container-1 + - name: container image: busybox command: [ "sleep", "3600" ] volumeMounts: diff --git a/test/pod-2.yaml b/test/pod-2.yaml new file mode 100644 index 0000000..1b9688b --- /dev/null +++ b/test/pod-2.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Pod +metadata: + name: pod-2 +spec: + containers: + - name: container + image: busybox + command: [ "sleep", "3600" ] + volumeMounts: + - mountPath: "/mnt/test" + name: test-volume + volumes: + - name: test-volume + persistentVolumeClaim: + claimName: pvc-2 + diff --git a/test/pvc-1.yaml b/test/pvc-1.yaml index 2a1044e..79e6a60 100644 --- a/test/pvc-1.yaml +++ b/test/pvc-1.yaml @@ -4,8 +4,7 @@ metadata: name: pvc-1 spec: accessModes: - - ReadWriteOnce + - ReadWriteMany resources: requests: storage: 10Mi - storageClassName: test diff --git a/test/pvc-2.yaml b/test/pvc-2.yaml index 438999b..0ae68d6 100644 --- a/test/pvc-2.yaml +++ b/test/pvc-2.yaml @@ -8,4 +8,3 @@ spec: resources: requests: storage: 10Mi - storageClassName: test diff --git a/test/sc.yaml b/test/sc.yaml deleted file mode 100644 index 47f6e85..0000000 --- a/test/sc.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: test -provisioner: rancher.io/local-path -reclaimPolicy: Delete -volumeBindingMode: Immediate