Skip to content

Commit fe7ffaa

Browse files
FxKuFelix Kunde
andauthored
trigger rolling update when securityContext of PodTemplate changes (zalando#1007)
Co-authored-by: Felix Kunde <[email protected]>
1 parent 3c352fb commit fe7ffaa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cluster/cluster.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,12 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa
455455
needsRollUpdate = true
456456
reasons = append(reasons, "new statefulset's pod template metadata annotations doesn't match the current one")
457457
}
458+
if !reflect.DeepEqual(c.Statefulset.Spec.Template.Spec.SecurityContext, statefulSet.Spec.Template.Spec.SecurityContext) {
459+
match = false
460+
needsReplace = true
461+
needsRollUpdate = true
462+
reasons = append(reasons, "new statefulset's pod template security context in spec doesn't match the current one")
463+
}
458464
if len(c.Statefulset.Spec.VolumeClaimTemplates) != len(statefulSet.Spec.VolumeClaimTemplates) {
459465
needsReplace = true
460466
reasons = append(reasons, "new statefulset's volumeClaimTemplates contains different number of volumes to the old one")

0 commit comments

Comments
 (0)