1
0
Fork 0

Respect service.nativelb=false annotation when nativeLBByDefault is enabled

This commit is contained in:
Simon Delicata 2025-07-08 11:58:04 +02:00 committed by GitHub
parent d674b393a8
commit cdacf0bca8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 669 additions and 13 deletions

View file

@ -2139,6 +2139,37 @@ func TestLoadConfigurationFromIngressesWithNativeLBByDefault(t *testing.T) {
},
},
},
{
desc: "Ingress with native lb by default but service has disabled nativelb",
expected: &dynamic.Configuration{
HTTP: &dynamic.HTTPConfiguration{
Middlewares: map[string]*dynamic.Middleware{},
Routers: map[string]*dynamic.Router{
"default-global-native-lb-traefik-tchouk-bar": {
Rule: "Host(`traefik.tchouk`) && PathPrefix(`/bar`)",
Service: "default-native-disabled-svc-web",
},
},
Services: map[string]*dynamic.Service{
"default-native-disabled-svc-web": {
LoadBalancer: &dynamic.ServersLoadBalancer{
Strategy: dynamic.BalancerStrategyWRR,
ResponseForwarding: &dynamic.ResponseForwarding{FlushInterval: dynamic.DefaultFlushInterval},
PassHostHeader: pointer(true),
Servers: []dynamic.Server{
{
URL: "http://10.10.0.20:8080",
},
{
URL: "http://10.10.0.21:8080",
},
},
},
},
},
},
},
},
}
for _, test := range testCases {