mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 12:54:25 +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]
|
||||
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)
|
||||
|
||||
spiloClient, err := newKubernetesSpiloClient(config)
|
||||
|
||||
Reference in New Issue
Block a user