refactor method name as per comments
This commit is contained in:
@@ -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 {
|
|||||||
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) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user