Skip to content

Commit

Permalink
Consider container names in Statefulset diffs
Browse files Browse the repository at this point in the history
This includes a comparison on container names being equal in the
decision of whether a Statefulset has been updated.
  • Loading branch information
Manuel Gómez committed Jan 15, 2018
1 parent 8c9033d commit d8e62b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cluster/cluster.go
Expand Up @@ -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))
Expand Down

0 comments on commit d8e62b9

Please sign in to comment.