This commit is contained in:
parent
b15afb8c06
commit
f0b618c712
1 changed files with 13 additions and 7 deletions
20
main.go
20
main.go
|
@ -28,15 +28,17 @@ type BackendServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Backend struct {
|
type Backend struct {
|
||||||
Name string
|
Name string
|
||||||
Balance string
|
Balance string
|
||||||
Mode string
|
Mode string
|
||||||
CookieName string
|
CookieName string
|
||||||
CookieFlags string
|
CookieFlags string
|
||||||
HealthCheck bool
|
HealthCheck bool
|
||||||
Servers []BackendServer
|
ServerOptions string
|
||||||
|
Servers []BackendServer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func getEnv(key, fallback string) string {
|
func getEnv(key, fallback string) string {
|
||||||
if val, ok := os.LookupEnv(key); ok && val != "" {
|
if val, ok := os.LookupEnv(key); ok && val != "" {
|
||||||
return val
|
return val
|
||||||
|
@ -221,6 +223,10 @@ func main() {
|
||||||
b.HealthCheck = false
|
b.HealthCheck = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if val, ok := ann["haproxy/server-options"]; ok && val != "" {
|
||||||
|
b.ServerOptions = val
|
||||||
|
}
|
||||||
|
|
||||||
servers := []BackendServer{}
|
servers := []BackendServer{}
|
||||||
serverIndex := 1
|
serverIndex := 1
|
||||||
for _, subset := range ep.Subsets {
|
for _, subset := range ep.Subsets {
|
||||||
|
|
Loading…
Add table
Reference in a new issue