Check if etcd service has its port exposed
This commit is contained in:
		
							parent
							
								
									d5a7683a38
								
							
						
					
					
						commit
						5b5a64e55d
					
				|  | @ -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) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue