mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-22 10:24:58 +02:00
GetMemberData should call the patroni endpoint
This commit is contained in:
@@ -124,6 +124,10 @@ func (p *Patroni) httpGet(url string) (string, error) {
|
|||||||
return "", fmt.Errorf("could not read response: %v", err)
|
return "", fmt.Errorf("could not read response: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if response.StatusCode != http.StatusOK {
|
||||||
|
return string(bodyBytes), fmt.Errorf("patroni returned '%d'", response.StatusCode)
|
||||||
|
}
|
||||||
|
|
||||||
return string(bodyBytes), nil
|
return string(bodyBytes), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +257,7 @@ func (p *Patroni) GetMemberData(server *v1.Pod) (MemberData, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return MemberData{}, err
|
return MemberData{}, err
|
||||||
}
|
}
|
||||||
body, err := p.httpGet(apiURLString)
|
body, err := p.httpGet(apiURLString + statusPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return MemberData{}, err
|
return MemberData{}, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user