compare revision hash instead of spec
This commit is contained in:
parent
c73f944846
commit
f7699b2714
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"reflect"
|
|
||||||
|
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
|
|
@ -344,7 +343,7 @@ func (c *Cluster) recreatePods() error {
|
||||||
role := PostgresRole(pod.Labels[c.OpConfig.PodRoleLabel])
|
role := PostgresRole(pod.Labels[c.OpConfig.PodRoleLabel])
|
||||||
|
|
||||||
// final check if spec of running pod differs from template
|
// 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)
|
c.logger.Infof("%q pod %q already updated", role, podName)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue