define readinessProbe on statefulSet (#1825)

* define readinessProbe on statefulSet 
* do not error out on deleting Patroni cluster objects
* change delete order for patroni objects
This commit is contained in:
Felix Kunde
2022-03-30 18:19:34 +02:00
committed by GitHub
parent a081173f26
commit 60e0685c32
12 changed files with 379 additions and 62 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ const (
clusterPath = "/cluster"
statusPath = "/patroni"
restartPath = "/restart"
apiPort = 8008
ApiPort = 8008
timeout = 30 * time.Second
)
@@ -74,7 +74,7 @@ func apiURL(masterPod *v1.Pod) (string, error) {
return "", fmt.Errorf("%s is not a valid IPv4/IPv6 address", masterPod.Status.PodIP)
}
}
return fmt.Sprintf("http://%s", net.JoinHostPort(ip.String(), strconv.Itoa(apiPort))), nil
return fmt.Sprintf("http://%s", net.JoinHostPort(ip.String(), strconv.Itoa(ApiPort))), nil
}
func (p *Patroni) httpPostOrPatch(method string, url string, body *bytes.Buffer) (err error) {
+3 -3
View File
@@ -36,17 +36,17 @@ func TestApiURL(t *testing.T) {
}{
{
"127.0.0.1",
fmt.Sprintf("http://127.0.0.1:%d", apiPort),
fmt.Sprintf("http://127.0.0.1:%d", ApiPort),
nil,
},
{
"0000:0000:0000:0000:0000:0000:0000:0001",
fmt.Sprintf("http://[::1]:%d", apiPort),
fmt.Sprintf("http://[::1]:%d", ApiPort),
nil,
},
{
"::1",
fmt.Sprintf("http://[::1]:%d", apiPort),
fmt.Sprintf("http://[::1]:%d", ApiPort),
nil,
},
{