Check if etcd service has its port exposed

This commit is contained in:
Murat Kabilov
2017-05-08 12:10:26 +02:00
parent d5a7683a38
commit 5b5a64e55d
+5
View File
@@ -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)