Skip to content
Permalink
Browse files

Break out of the loop when active endpoint is found

  • Loading branch information...
tedyu authored and yutedz committed Sep 11, 2019
1 parent 8b4fd41 commit 31581e7cb5b26786ab4a9122bb62fb8ce0ec5b79
@@ -210,6 +210,7 @@ func (c *AvailableConditionController) sync(key string) error {
if port.Port == *servicePort {
foundPort = true
portName = port.Name
break
}
}
if !foundPort {
@@ -238,13 +239,15 @@ func (c *AvailableConditionController) sync(key string) error {
return err
}
hasActiveEndpoints := false
outer:
for _, subset := range endpoints.Subsets {
if len(subset.Addresses) == 0 {
continue
}
for _, endpointPort := range subset.Ports {
if endpointPort.Name == portName {
hasActiveEndpoints = true
break outer
}
}
}

0 comments on commit 31581e7

Please sign in to comment.
You can’t perform that action at this time.