Skip to content

Commit

Permalink
Merge pull request #388 from andrewsykim/node-fix-delete-1.2
Browse files Browse the repository at this point in the history
Cherrypick 387 to release-1.2
  • Loading branch information
k8s-ci-robot authored Aug 26, 2020
2 parents bebaf92 + 13cc4ee commit 09628f0
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/cloudprovider/vsphere/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,8 @@ func (i *instances) InstanceID(ctx context.Context, nodeName types.NodeName) (st
return i.nodeManager.nodeNameMap[string(nodeName)].UUID, nil
}

if err != vclib.ErrNoVMFound {
klog.V(4).Infof("instances.InstanceID() failed with err: %v", err)
return "", err
}

// at this point, err is vclib.ErrNoVMFound
if _, ok := os.LookupEnv("SKIP_NODE_DELETION"); ok {
klog.V(4).Infof("instances.InstanceID() NOT FOUND for node %s. Override and prevent deletion.", string(nodeName))
return "", err
}

klog.V(4).Info("instances.InstanceID() NOT FOUND with ", string(nodeName))
return "", cloudprovider.InstanceNotFound
klog.V(4).Infof("instances.InstanceID() failed with err: %v", err)
return "", err
}

// InstanceType returns the type of the instance identified by name.
Expand Down

0 comments on commit 09628f0

Please sign in to comment.