mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-25 01:13:40 +01:00
Add logs for Kubernetes auto discover
This commit is contained in:
parent
f406206eae
commit
a658100da4
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user