Update main.go
Some checks failed
Build Go Binary / build (push) Has been cancelled

This commit is contained in:
holzi1005 2025-08-06 12:47:50 +02:00
parent b15afb8c06
commit f0b618c712

20
main.go
View file

@ -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 {