mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 09:21:16 +02:00
Perform manual failover during the scale down
This commit is contained in:
@@ -41,7 +41,7 @@ func New(logger *logrus.Entry) *Patroni {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Patroni) apiURL(masterPod *v1.Pod) string {
|
||||
func apiURL(masterPod *v1.Pod) string {
|
||||
return fmt.Sprintf("http://%s:%d", masterPod.Status.PodIP, apiPort)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func (p *Patroni) Failover(master *v1.Pod, candidate string) error {
|
||||
return fmt.Errorf("could not encode json: %v", err)
|
||||
}
|
||||
|
||||
request, err := http.NewRequest(http.MethodPost, p.apiURL(master)+failoverPath, buf)
|
||||
request, err := http.NewRequest(http.MethodPost, apiURL(master)+failoverPath, buf)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not create request: %v", err)
|
||||
}
|
||||
@@ -77,4 +77,4 @@ func (p *Patroni) Failover(master *v1.Pod, candidate string) error {
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user