move error messages out of retry
This commit is contained in:
parent
d9755db4d5
commit
ca129eb9da
|
|
@ -321,17 +321,16 @@ func (c *Cluster) isSafeToRecreatePods(pods *v1.PodList) bool {
|
||||||
state, err = c.patroni.GetPatroniMemberState(&pod)
|
state, err = c.patroni.GetPatroniMemberState(&pod)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.logger.Errorf("failed to get Patroni state for pod: %s", err)
|
|
||||||
return false, err
|
return false, err
|
||||||
} else if state == "creating replica" {
|
} else if state == "creating replica" {
|
||||||
c.logger.Warningf("cannot re-create replica %s: it is currently being initialized", pod.Name)
|
return false, fmt.Errorf("cannot re-create replica %s: it is currently being initialized", pod.Name)
|
||||||
return false, nil
|
|
||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
c.logger.Errorf("failed to get Patroni state for pod: %s", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue