mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 17:00:56 +02:00
pick first container if postgres is not found (#1505)
* pick first container if postgres is not found * minor change
This commit is contained in:
@@ -462,7 +462,7 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa
|
||||
|
||||
if len(c.Statefulset.Spec.Template.Spec.Volumes) != len(statefulSet.Spec.Template.Spec.Volumes) {
|
||||
needsReplace = true
|
||||
reasons = append(reasons, fmt.Sprintf("new statefulset's Volumes contains different number of volumes to the old one"))
|
||||
reasons = append(reasons, "new statefulset's volumes contains different number of volumes to the old one")
|
||||
}
|
||||
|
||||
// we assume any change in priority happens by rolling out a new priority class
|
||||
@@ -476,7 +476,9 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa
|
||||
|
||||
// lazy Spilo update: modify the image in the statefulset itself but let its pods run with the old image
|
||||
// until they are re-created for other reasons, for example node rotation
|
||||
if c.OpConfig.EnableLazySpiloUpgrade && !reflect.DeepEqual(c.Statefulset.Spec.Template.Spec.Containers[0].Image, statefulSet.Spec.Template.Spec.Containers[0].Image) {
|
||||
effectivePodImage := getPostgresContainer(&c.Statefulset.Spec.Template.Spec).Image
|
||||
desiredImage := getPostgresContainer(&statefulSet.Spec.Template.Spec).Image
|
||||
if c.OpConfig.EnableLazySpiloUpgrade && !reflect.DeepEqual(effectivePodImage, desiredImage) {
|
||||
needsReplace = true
|
||||
reasons = append(reasons, "lazy Spilo update: new statefulset's pod image does not match the current one")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user