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:
		
							parent
							
								
									8c9033df28
								
							
						
					
					
						commit
						bf4406d2a4
					
				|  | @ -311,6 +311,10 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *v1beta1.StatefulSet) *comp | ||||||
| 	} else { | 	} else { | ||||||
| 		for index, container1 := range c.Statefulset.Spec.Template.Spec.Containers { | 		for index, container1 := range c.Statefulset.Spec.Template.Spec.Containers { | ||||||
| 			container2 := statefulSet.Spec.Template.Spec.Containers[index] | 			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 { | 			if container1.Image != container2.Image { | ||||||
| 				needsRollUpdate = true | 				needsRollUpdate = true | ||||||
| 				reasons = append(reasons, fmt.Sprintf("new statefulset's container %d image doesn't match the current one", index)) | 				reasons = append(reasons, fmt.Sprintf("new statefulset's container %d image doesn't match the current one", index)) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue