Revert "Revert "Modify nodes to register directly with the master.""

This reverts commit c53786ab31.
This commit is contained in:
CJ Cullen
2015-05-20 14:21:03 -07:00
parent a76bdd9710
commit bf646abf8d
12 changed files with 314 additions and 876 deletions

View File

@@ -444,7 +444,10 @@ func (gce *GCECloud) getInstanceByName(name string) (*compute.Instance, error) {
name = canonicalizeInstanceName(name)
res, err := gce.service.Instances.Get(gce.projectID, gce.zone, name).Do()
if err != nil {
glog.Errorf("Failed to retrieve TargetInstance resource for instance:%s", name)
glog.Errorf("Failed to retrieve TargetInstance resource for instance: %s", name)
if apiErr, ok := err.(*googleapi.Error); ok && apiErr.Code == http.StatusNotFound {
return nil, cloudprovider.InstanceNotFound
}
return nil, err
}
return res, nil