mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-21 10:53:49 +02:00
Check if etcd service has its port exposed
This commit is contained in:
@@ -36,6 +36,11 @@ func New(options Options) *SpiloOperator {
|
|||||||
}
|
}
|
||||||
ports := etcdService.Spec.Ports[0]
|
ports := etcdService.Spec.Ports[0]
|
||||||
nodeurl, _ := url.Parse(config.Host)
|
nodeurl, _ := url.Parse(config.Host)
|
||||||
|
|
||||||
|
if ports.NodePort == 0 {
|
||||||
|
log.Fatalln("Etcd port is not exposed")
|
||||||
|
}
|
||||||
|
|
||||||
etcdHostOutside := fmt.Sprintf("http://%s:%d", strings.Split(nodeurl.Host, ":")[0], ports.NodePort)
|
etcdHostOutside := fmt.Sprintf("http://%s:%d", strings.Split(nodeurl.Host, ":")[0], ports.NodePort)
|
||||||
|
|
||||||
spiloClient, err := newKubernetesSpiloClient(config)
|
spiloClient, err := newKubernetesSpiloClient(config)
|
||||||
|
|||||||
Reference in New Issue
Block a user