mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Modify nodes to register directly with the master.
- Delete nodes when they are no longer ready and don't exist in the cloud provider. - Label each node with it's hostname. - Add flag to skip node registration. - Add a test for registering an existing node.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user