GetMemberData should call the patroni endpoint
This commit is contained in:
parent
957c2582f6
commit
c49974c166
|
|
@ -124,6 +124,10 @@ func (p *Patroni) httpGet(url string) (string, error) {
|
|||
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
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +257,7 @@ func (p *Patroni) GetMemberData(server *v1.Pod) (MemberData, error) {
|
|||
if err != nil {
|
||||
return MemberData{}, err
|
||||
}
|
||||
body, err := p.httpGet(apiURLString)
|
||||
body, err := p.httpGet(apiURLString + statusPath)
|
||||
if err != nil {
|
||||
return MemberData{}, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue