Perform manual failover during the scale down

This commit is contained in:
Murat Kabilov
2017-10-16 17:41:23 +02:00
committed by GitHub
parent 5b29576a8e
commit 6c4cb4e9da
7 changed files with 121 additions and 13 deletions
+3 -3
View File
@@ -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
}
}