Fix a bug where we don't return an error.

This commit is contained in:
Brendan Burns 2014-09-09 09:55:55 -07:00
parent d7f84aef82
commit a343a93b2d

View File

@ -120,10 +120,12 @@ func (s ConfigSourceEtcd) Run() {
func (s ConfigSourceEtcd) GetServices() ([]api.Service, []api.Endpoints, error) {
response, err := s.client.Get(registryRoot+"/specs", true, false)
if err != nil {
glog.V(1).Infof("Failed to get the key %s: %v", registryRoot, err)
if tools.IsEtcdNotFound(err) {
return []api.Service{}, []api.Endpoints{}, err
glog.V(1).Infof("Failed to get the key %s: %v", registryRoot, err)
} else {
glog.Errorf("Failed to contact etcd for key %s: %v", registryRoot, err)
}
return []api.Service{}, []api.Endpoints{}, err
}
if response.Node.Dir == true {
retServices := make([]api.Service, len(response.Node.Nodes))