Skip to content

Commit 18f9e00

Browse files
committed
feat(marketplace): also annotate nodes on upgrade to support shim upgrade
Signed-off-by: Vaughn Dice <[email protected]>
1 parent 65b517f commit 18f9e00

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

marketplace/charts/spinkube-azure-marketplace/templates/kwasm-annotate-nodes-job.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Job
33
metadata:
44
name: "{{ .Release.Name }}-kwasm-annotate-nodes"
55
annotations:
6-
"helm.sh/hook": post-install
6+
"helm.sh/hook": post-install,post-upgrade
77
"helm.sh/hook-weight": "-4"
88
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
99
spec:
@@ -15,8 +15,13 @@ spec:
1515
containers:
1616
- name: kubectl
1717
image: {{ printf "%s/%s:%s" .Values.global.azure.images.kubectl.registry .Values.global.azure.images.kubectl.image .Values.global.azure.images.kubectl.tag }}
18-
command: ["kubectl"]
19-
args: ["annotate", "node", "--all", "kwasm.sh/kwasm-node=true"]
18+
command: ["/bin/sh", "-c"]
19+
args:
20+
- |-
21+
echo "Annotating node with kwasm.sh/kwasm-node=false to reset installation of the shim for upgrade scenarios"
22+
kubectl annotate node --all kwasm.sh/kwasm-node=false --overwrite
23+
echo "Annotating node with kwasm.sh/kwasm-node=true to (re-)trigger installation of the shim"
24+
kubectl annotate node --all kwasm.sh/kwasm-node=true --overwrite
2025
restartPolicy: OnFailure
2126
---
2227
apiVersion: v1

0 commit comments

Comments
 (0)