Merge pull request #85521 from gaorong/check-return-value

check service status value returned by EnsureLoadBalancer
This commit is contained in:
Kubernetes Prow Robot 2019-11-25 22:51:10 -08:00 committed by GitHub
commit 41757d673e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,6 +351,10 @@ func (s *Controller) syncLoadBalancerIfNeeded(service *v1.Service, key string) (
}
return op, fmt.Errorf("failed to ensure load balancer: %v", err)
}
if newStatus == nil {
return op, fmt.Errorf("service status returned by EnsureLoadBalancer is nil")
}
s.eventRecorder.Event(service, v1.EventTypeNormal, "EnsuredLoadBalancer", "Ensured load balancer")
}