Commit ab797d1b authored by Alex Robinson's avatar Alex Robinson

A load balancer should be updated if a service's UID has changed.

The load balancer's name is determined by the service's UID. If the service's UID has changed (presumably due to a delete and recreate), then we need to recreate the load balancer as well to avoid eventually leaking the old one.
parent 4ce5f68e
...@@ -498,6 +498,11 @@ func (s *ServiceController) needsUpdate(oldService *api.Service, newService *api ...@@ -498,6 +498,11 @@ func (s *ServiceController) needsUpdate(oldService *api.Service, newService *api
if !reflect.DeepEqual(oldService.Annotations, newService.Annotations) { if !reflect.DeepEqual(oldService.Annotations, newService.Annotations) {
return true return true
} }
if oldService.UID != newService.UID {
s.eventRecorder.Eventf(newService, api.EventTypeNormal, "UID", "%v -> %v",
oldService.UID, newService.UID)
return true
}
return false return false
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment