mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 22:05:59 +00:00
Correct the style of nested conditionals
This commit is contained in:
parent
60dd1f7cc0
commit
1bd7276aca
@ -127,14 +127,15 @@ func (proxier Proxier) OnUpdate(services []api.Service) {
|
|||||||
glog.Infof("Received update notice: %+v", services)
|
glog.Infof("Received update notice: %+v", services)
|
||||||
for _, service := range services {
|
for _, service := range services {
|
||||||
port, exists := proxier.serviceMap[service.ID]
|
port, exists := proxier.serviceMap[service.ID]
|
||||||
if !exists || port != service.Port {
|
if exists && port == service.Port {
|
||||||
|
continue
|
||||||
|
}
|
||||||
glog.Infof("Adding a new service %s on port %d", service.ID, service.Port)
|
glog.Infof("Adding a new service %s on port %d", service.ID, service.Port)
|
||||||
err := proxier.addService(service.ID, service.Port)
|
err := proxier.addService(service.ID, service.Port)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
proxier.serviceMap[service.ID] = service.Port
|
|
||||||
} else {
|
|
||||||
glog.Infof("Failed to start listening for %s on %d", service.ID, service.Port)
|
glog.Infof("Failed to start listening for %s on %d", service.ID, service.Port)
|
||||||
}
|
continue
|
||||||
}
|
}
|
||||||
|
proxier.serviceMap[service.ID] = service.Port
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user