Skip to content

Commit 16decd8

Browse files
authored
better log failures to upgrade the nginx helm chart and why (#395)
1 parent 33014a1 commit 16decd8

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

e2e/scripts/check-postupgrade-state.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,22 @@ main() {
6060

6161
# ensure that nginx-ingress has been updated
6262
kubectl describe chart -n kube-system k0s-addon-chart-ingress-nginx
63-
kubectl describe chart -n kube-system k0s-addon-chart-ingress-nginx | grep -q "test-upgrade-value" # ensure new values are present
64-
kubectl describe chart -n kube-system k0s-addon-chart-ingress-nginx | grep -q "4.9.1" # ensure new version is present
65-
kubectl describe pod -n ingress-nginx | grep -q "4.9.1" # ensure the new version made it into the pod
63+
# ensure new values are present
64+
if ! kubectl describe chart -n kube-system k0s-addon-chart-ingress-nginx | grep -q "test-upgrade-value"; then
65+
echo "test-upgrade-value not found in ingress-nginx chart"
66+
exit 1
67+
fi
68+
# ensure new version is present
69+
if ! kubectl describe chart -n kube-system k0s-addon-chart-ingress-nginx | grep -q "4.9.1"; then
70+
echo "4.9.1 not found in ingress-nginx chart"
71+
exit 1
72+
fi
73+
# ensure the new version made it into the pod
74+
if ! kubectl describe pod -n ingress-nginx | grep -q "4.9.1" ; then
75+
echo "4.9.1 not found in ingress-nginx pod"
76+
kubectl describe pod -n ingress-nginx
77+
exit 1
78+
fi
6679

6780
# ensure that the embedded-cluster-operator has been updated
6881
kubectl describe chart -n kube-system k0s-addon-chart-embedded-cluster-operator

0 commit comments

Comments
 (0)