Fix security context comparison logic in StatefulSet
This commit is contained in:
parent
fa4bc21538
commit
dde68cfb34
|
|
@ -530,9 +530,15 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa
|
||||||
reasons = append(reasons, "new statefulset's pod template metadata annotations does not match "+reason)
|
reasons = append(reasons, "new statefulset's pod template metadata annotations does not match "+reason)
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(c.Statefulset.Spec.Template.Spec.SecurityContext, statefulSet.Spec.Template.Spec.SecurityContext) {
|
if !reflect.DeepEqual(c.Statefulset.Spec.Template.Spec.SecurityContext, statefulSet.Spec.Template.Spec.SecurityContext) {
|
||||||
needsReplace = true
|
//needsReplace = true
|
||||||
needsRollUpdate = true
|
//needsRollUpdate = true
|
||||||
reasons = append(reasons, "new statefulset's pod template security context in spec does not match the current one")
|
//reasons = append(reasons, "new statefulset's pod template security context in spec does not match the current one")
|
||||||
|
if reflect.ValueOf(statefulSet.Spec.Template.Spec.SecurityContext.SeccompProfile).IsNil() {
|
||||||
|
} else {
|
||||||
|
needsReplace = true
|
||||||
|
needsRollUpdate = true
|
||||||
|
reasons = append(reasons, "new statefulset's pod template security context in spec does not match the current one")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if len(c.Statefulset.Spec.VolumeClaimTemplates) != len(statefulSet.Spec.VolumeClaimTemplates) {
|
if len(c.Statefulset.Spec.VolumeClaimTemplates) != len(statefulSet.Spec.VolumeClaimTemplates) {
|
||||||
needsReplace = true
|
needsReplace = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue