mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 06:01:50 +00:00
Clear LoadBalancerStatus both on LB delete and on update in the API
Although it takes some time to destroy a load balancer, we hide this complexity from the user.
This commit is contained in:
@@ -265,6 +265,12 @@ func (rs *REST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, boo
|
||||
nodePortOp.ReleaseDeferred(oldNodePort)
|
||||
}
|
||||
|
||||
// Remove any LoadBalancerStatus now if Type != LoadBalancer;
|
||||
// although loadbalancer delete is actually asynchronous, we don't need to expose the user to that complexity.
|
||||
if service.Spec.Type != api.ServiceTypeLoadBalancer {
|
||||
service.Status.LoadBalancer = api.LoadBalancerStatus{}
|
||||
}
|
||||
|
||||
out, err := rs.registry.UpdateService(ctx, service)
|
||||
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user