diff --git a/pkg/cluster/pod.go b/pkg/cluster/pod.go index cb7733c1b..0557e3cfd 100644 --- a/pkg/cluster/pod.go +++ b/pkg/cluster/pod.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "math/rand" - "reflect" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" @@ -344,7 +343,7 @@ func (c *Cluster) recreatePods() error { role := PostgresRole(pod.Labels[c.OpConfig.PodRoleLabel]) // final check if spec of running pod differs from template - if reflect.DeepEqual(pod.Spec, c.Statefulset.Spec.Template.Spec) { + if pod.ObjectMeta.Labels["controller-revision-hash"] == c.Statefulset.Status.CurrentRevision { c.logger.Infof("%q pod %q already updated", role, podName) continue }