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.
This commit is contained in:
Alex Robinson 2016-02-26 19:38:19 +00:00
parent 4ce5f68ed0
commit ab797d1b65

View File

@ -498,6 +498,11 @@ func (s *ServiceController) needsUpdate(oldService *api.Service, newService *api
if !reflect.DeepEqual(oldService.Annotations, newService.Annotations) {
return true
}
if oldService.UID != newService.UID {
s.eventRecorder.Eventf(newService, api.EventTypeNormal, "UID", "%v -> %v",
oldService.UID, newService.UID)
return true
}
return false
}