Commit 82a69b28 authored by Josh Horwitz's avatar Josh Horwitz

refactor method name as per comments

parent 3528ceb2
...@@ -237,7 +237,7 @@ func (cnc *CloudNodeController) MonitorNode() { ...@@ -237,7 +237,7 @@ func (cnc *CloudNodeController) MonitorNode() {
if currentReadyCondition.Status != v1.ConditionTrue { if currentReadyCondition.Status != v1.ConditionTrue {
// Check with the cloud provider to see if the node still exists. If it // Check with the cloud provider to see if the node still exists. If it
// doesn't, delete the node immediately. // doesn't, delete the node immediately.
exists, err := ensureNodeExistsByProviderIDOrName(instances, node) exists, err := ensureNodeExistsByProviderIDOrExternalID(instances, node)
if err != nil { if err != nil {
glog.Errorf("Error getting data for node %s from cloud: %v", node.Name, err) glog.Errorf("Error getting data for node %s from cloud: %v", node.Name, err)
continue continue
...@@ -382,8 +382,8 @@ func excludeTaintFromList(taints []v1.Taint, toExclude v1.Taint) []v1.Taint { ...@@ -382,8 +382,8 @@ func excludeTaintFromList(taints []v1.Taint, toExclude v1.Taint) []v1.Taint {
return newTaints return newTaints
} }
// ensureNodeExistsByProviderIDOrName first checks if the instance exists by the provider id and then by node name // ensureNodeExistsByProviderIDOrExternalID first checks if the instance exists by the provider id and then by calling external id with node name
func ensureNodeExistsByProviderIDOrName(instances cloudprovider.Instances, node *v1.Node) (bool, error) { func ensureNodeExistsByProviderIDOrExternalID(instances cloudprovider.Instances, node *v1.Node) (bool, error) {
exists, err := instances.InstanceExistsByProviderID(node.Spec.ProviderID) exists, err := instances.InstanceExistsByProviderID(node.Spec.ProviderID)
if err != nil { if err != nil {
providerIDErr := err providerIDErr := err
......
...@@ -128,7 +128,7 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) { ...@@ -128,7 +128,7 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) {
} }
instances, _ := fc.Instances() instances, _ := fc.Instances()
exists, err := ensureNodeExistsByProviderIDOrName(instances, tc.node) exists, err := ensureNodeExistsByProviderIDOrExternalID(instances, tc.node)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment