Add logs for Kubernetes auto discover

This commit is contained in:
TwinProduction 2020-11-11 15:14:21 -05:00
parent f406206eae
commit a658100da4

View File

@ -135,11 +135,15 @@ func validateKubernetesConfig(config *Config) {
if config.Kubernetes.ServiceTemplate == nil { if config.Kubernetes.ServiceTemplate == nil {
panic("kubernetes.service-template cannot be nil") panic("kubernetes.service-template cannot be nil")
} }
if config.Debug {
log.Println("[config][validateKubernetesConfig] Automatically discovering Kubernetes services...")
}
discoveredServices, err := k8s.DiscoverServices(config.Kubernetes) discoveredServices, err := k8s.DiscoverServices(config.Kubernetes)
if err != nil { if err != nil {
panic(err) panic(err)
} }
config.Services = append(config.Services, discoveredServices...) config.Services = append(config.Services, discoveredServices...)
log.Printf("[config][validateKubernetesConfig] Discovered %d Kubernetes services", len(discoveredServices))
} }
} }