From bf4406d2a49deb73830eeb72cb1b35cdccd846e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20G=C3=B3mez?= Date: Tue, 16 Jan 2018 12:06:11 +0100 Subject: [PATCH] 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. --- pkg/cluster/cluster.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 3ed4c156d..19d8b6048 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -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))