Skip to content

Commit 6bb2e3f

Browse files
committed
Ensure that holder-update DaemonSet pods are restarted on script changes
We add the script's md5sum as an annotation to the DaemonSet pod template to force Kubernetes to recreate the pods when we modify the script.
1 parent 32e1338 commit 6bb2e3f

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

component/restart-holder-ds.libsonnet

+5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ local daemonset = kube.DaemonSet('syn-holder-updater') {
9494
},
9595
spec+: {
9696
template+: {
97+
metadata+: {
98+
annotations+: {
99+
'script-checksum': std.md5(script),
100+
},
101+
},
97102
spec+: {
98103
serviceAccountName: serviceaccount.metadata.name,
99104
containers_: {

tests/golden/cephfs/rook-ceph/rook-ceph/50_restart_holder_ds.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ spec:
123123
name: syn-holder-updater
124124
template:
125125
metadata:
126-
annotations: {}
126+
annotations:
127+
script-checksum: 488da91788ef6e501cece9d3d67ff8b0
127128
labels:
128129
app.kubernetes.io/component: rook-ceph
129130
app.kubernetes.io/managed-by: commodore

tests/golden/defaults/rook-ceph/rook-ceph/50_restart_holder_ds.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ spec:
123123
name: syn-holder-updater
124124
template:
125125
metadata:
126-
annotations: {}
126+
annotations:
127+
script-checksum: 488da91788ef6e501cece9d3d67ff8b0
127128
labels:
128129
app.kubernetes.io/component: rook-ceph
129130
app.kubernetes.io/managed-by: commodore

tests/golden/openshift4/rook-ceph/rook-ceph/50_restart_holder_ds.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ spec:
123123
name: syn-holder-updater
124124
template:
125125
metadata:
126-
annotations: {}
126+
annotations:
127+
script-checksum: 488da91788ef6e501cece9d3d67ff8b0
127128
labels:
128129
app.kubernetes.io/component: rook-ceph
129130
app.kubernetes.io/managed-by: commodore

0 commit comments

Comments
 (0)