Merge pull request #1231 from brendandburns/service

Fix a bug where we don't return an error.
This commit is contained in:
Daniel Smith 2014-09-09 12:48:19 -07:00
commit 1fd12778eb

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))