Allow an empty service
This commit is contained in:
@@ -51,11 +51,11 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
||||
}
|
||||
var resultErr error
|
||||
for _, service := range services.Items {
|
||||
if service.Name == "kubernetes" || service.Name == "kubernetes-ro" {
|
||||
// This is a temporary hack for supporting the master services
|
||||
// until we actually start running apiserver in a pod.
|
||||
if service.Spec.Selector == nil {
|
||||
// services without a selector receive no endpoints. The last endpoint will be used.
|
||||
continue
|
||||
}
|
||||
|
||||
glog.Infof("About to update endpoints for service %v", service.Name)
|
||||
pods, err := e.client.Pods(service.Namespace).List(labels.Set(service.Spec.Selector).AsSelector())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user