diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index 6b115eef5ab..02f7c783b22 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -1386,7 +1386,9 @@ func (c *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID str } if len(instances) == 0 { glog.Warningf("the instance %s does not exist anymore", providerID) - return true, nil + // returns false, because otherwise node is not deleted from cluster + // false means that it will continue to check InstanceExistsByProviderID + return false, nil } if len(instances) > 1 { return false, fmt.Errorf("multiple instances found for instance: %s", instanceID) @@ -1396,7 +1398,7 @@ func (c *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID str if instance.State != nil { state := aws.StringValue(instance.State.Name) // valid state for detaching volumes - if state == ec2.InstanceStateNameStopped || state == ec2.InstanceStateNameTerminated { + if state == ec2.InstanceStateNameStopped { return true, nil } }