Fix multiple subsets endpoint

This commit is contained in:
João Silva 2023-05-31 10:40:05 +01:00 committed by GitHub
parent 8d8717d421
commit 6977b68b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 100 additions and 2 deletions

View file

@ -414,8 +414,8 @@ func (c configBuilder) loadServers(parentNamespace string, svc traefikv1alpha1.L
return nil, fmt.Errorf("subset not found for %s/%s", namespace, sanitizedName)
}
var port int32
for _, subset := range endpoints.Subsets {
var port int32
for _, p := range subset.Ports {
if svcPort.Name == p.Name {
port = p.Port
@ -424,7 +424,7 @@ func (c configBuilder) loadServers(parentNamespace string, svc traefikv1alpha1.L
}
if port == 0 {
return nil, fmt.Errorf("cannot define a port for %s/%s", namespace, sanitizedName)
continue
}
protocol, err := parseServiceProtocol(svc.Scheme, svcPort.Name, svcPort.Port)