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:
Justin Santa Barbara
2015-05-22 18:59:45 -04:00
parent a271771341
commit bb697cee7e
2 changed files with 25 additions and 19 deletions

View File

@@ -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 {