mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-04 13:11:52 +02:00
wait after config patch and restart on sync whenever we see pending_restart
This commit is contained in:
@@ -238,16 +238,12 @@ func (p *Patroni) Restart(server *v1.Pod) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
memberData, err := p.GetMemberData(server)
|
||||
if err != nil {
|
||||
if err := p.httpPostOrPatch(http.MethodPost, apiURLString+restartPath, buf); err != nil {
|
||||
return err
|
||||
}
|
||||
p.logger.Infof("Postgres server successfuly restarted in pod %s", server.Name)
|
||||
|
||||
// do restart only when it is pending
|
||||
if !memberData.PendingRestart {
|
||||
return nil
|
||||
}
|
||||
return p.httpPostOrPatch(http.MethodPost, apiURLString+restartPath, buf)
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetMemberData read member data from patroni API
|
||||
|
||||
Reference in New Issue
Block a user