mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
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:
parent
4ce5f68ed0
commit
ab797d1b65
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user