This commit is contained in:
parent
08f953b7ef
commit
144fbdd18b
1 changed files with 6 additions and 2 deletions
8
main.go
8
main.go
|
@ -96,6 +96,7 @@ func main() {
|
|||
k8sToken := getEnv("KUBERNETES_TOKEN", "")
|
||||
verifySSLStr := getEnv("KUBERNETES_VERIFYSSL", "false")
|
||||
templatePath := getEnv("HAPROXY_TEMPLATE", "haproxy.tmpl")
|
||||
annotationCheckEnabled := os.Getenv("KUBERNETES_ANNOTATION_HAPROXY") != ""
|
||||
|
||||
if k8sHost == "" || k8sToken == "" {
|
||||
log.Fatal("KUBERNETES_HOST and KUBERNETES_TOKEN must be set")
|
||||
|
@ -183,8 +184,11 @@ func main() {
|
|||
continue
|
||||
}
|
||||
|
||||
if val, ok := svc.Metadata.Annotations["haproxy/enabled"]; !ok || val != "true" {
|
||||
continue
|
||||
if annotationCheckEnabled {
|
||||
val, ok := svc.Metadata.Annotations["haproxy/enabled"]
|
||||
if !ok || val != "true" {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
key := svc.Metadata.Namespace + "/" + svc.Metadata.Name
|
||||
|
|
Loading…
Add table
Reference in a new issue