Consider container names in Statefulset diffs (#210)

This includes a comparison on container names being equal in the
decision of whether a Statefulset has been updated.
This commit is contained in:
Manuel Gómez 2018-01-16 12:06:11 +01:00 committed by Oleksii Kliukin
parent 8c9033df28
commit bf4406d2a4
1 changed files with 4 additions and 0 deletions

View File

@ -311,6 +311,10 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *v1beta1.StatefulSet) *comp
} else {
for index, container1 := range c.Statefulset.Spec.Template.Spec.Containers {
container2 := statefulSet.Spec.Template.Spec.Containers[index]
if container1.Name != container2.Name {
needsRollUpdate = true
reasons = append(reasons, fmt.Sprintf("new statefulset's container %d name doesn't match the current one", index))
}
if container1.Image != container2.Image {
needsRollUpdate = true
reasons = append(reasons, fmt.Sprintf("new statefulset's container %d image doesn't match the current one", index))