66 pull_request :
77 branches : ["main"]
88
9+ env :
10+ # This version should match the (forked) version of the spin-operator sub-chart
11+ SPIN_OPERATOR_VERSION : v0.3.0
12+
913jobs :
1014 helm-install-smoke-test :
1115 runs-on : ubuntu-22.04
@@ -31,13 +35,13 @@ jobs:
3135
3236 - name : run spin app
3337 run : |
34- kubectl apply -f https://raw.githubusercontent.com/spinkube/spin-operator/main /config/samples/simple.yaml
38+ kubectl apply -f https://raw.githubusercontent.com/spinkube/spin-operator/${{ env.SPIN_OPERATOR_VERSION }} /config/samples/simple.yaml
3539 kubectl rollout status deployment simple-spinapp --timeout 90s
3640 kubectl get pods -A
3741 kubectl port-forward svc/simple-spinapp 8083:80 &
3842 timeout 15s bash -c 'until curl -f -vvv http://localhost:8083/hello; do sleep 2; done'
3943
40- - name : debug
44+ - name : debug install
4145 if : failure()
4246 run : |
4347 kubectl get pods -A
5155
5256 - name : Verify curl
5357 run : curl localhost:8083/hello
58+
59+ - name : helm delete spinkube
60+ run : |
61+ if helm delete spinkube --timeout 1m --namespace spinkube; then
62+ echo "A Spin App remains on the cluster; the helm release should not have uninstalled successfully."
63+ exit 1
64+ fi
65+
66+ kubectl logs -n spinkube -l job-name=spinkube-pre-delete | \
67+ grep -q "There are 1 SpinApps still existing on the cluster; aborting helm release deletion."
68+
69+ - name : Ensure Spin app still reachable
70+ run : curl localhost:8083/hello
71+
72+ - name : Ensure SpinKube resources still exist
73+ run : |
74+ kubectl get po -n spinkube -o name | grep -q spin-operator
75+ kubectl get po -n spinkube -o name | grep -q kwasm-operator
76+ kubectl get po -n spinkube -o name | grep -q cert-manager
77+ kubectl get crd -o name | grep -q spinapp
78+ kubectl get crd -o name | grep -q cert-manager
79+
80+ - name : Delete Spin App
81+ run : kubectl delete spinapp simple-spinapp
82+
83+ - name : helm delete spinkube
84+ run : helm delete spinkube --timeout 1m --namespace spinkube
85+
86+ - name : Verify all resources are deleted
87+ run : |
88+ timeout 15s bash -c 'until ! kubectl get crd -o name | grep -q cert-manager; do sleep 2; done'
89+ timeout 15s bash -c 'until ! kubectl get crd -o name | grep -q spinapp; do sleep 2; done'
90+ timeout 15s bash -c 'until ! kubectl get ns -o name | grep -q spinkube; do sleep 2; done'
91+
92+ - name : debug uninstall
93+ if : failure()
94+ run : |
95+ kubectl get pods -A
96+ kubectl get crd -A
97+ kubectl get ns -A
98+ kubectl describe pods -A
99+ kubectl describe crd -A
100+ kubectl describe ns -A
0 commit comments