From 7062cd570038abdfedd0e660682856daedd18dd1 Mon Sep 17 00:00:00 2001 From: Jesse Haka Date: Wed, 29 Aug 2018 14:22:53 +0300 Subject: [PATCH] backport https://github.com/kubernetes/cloud-provider-openstack/pull/43 --- .../providers/openstack/openstack_instances.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/cloudprovider/providers/openstack/openstack_instances.go b/pkg/cloudprovider/providers/openstack/openstack_instances.go index 638b78508d8..61669e904df 100644 --- a/pkg/cloudprovider/providers/openstack/openstack_instances.go +++ b/pkg/cloudprovider/providers/openstack/openstack_instances.go @@ -106,7 +106,7 @@ func (i *Instances) NodeAddressesByProviderID(ctx context.Context, providerID st return addresses, nil } -// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running. +// InstanceExistsByProviderID returns true if the instance with the given provider id still exist. // If false is returned with no error, the instance will be immediately deleted by the cloud controller manager. func (i *Instances) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error) { instanceID, err := instanceIDFromProviderID(providerID) @@ -114,7 +114,7 @@ func (i *Instances) InstanceExistsByProviderID(ctx context.Context, providerID s return false, err } - server, err := servers.Get(i.compute, instanceID).Extract() + _, err := servers.Get(i.compute, instanceID).Extract() if err != nil { if isNotFound(err) { return false, nil @@ -122,11 +122,6 @@ func (i *Instances) InstanceExistsByProviderID(ctx context.Context, providerID s return false, err } - if server.Status != "ACTIVE" { - glog.Warningf("the instance %s is not active", instanceID) - return false, nil - } - return true, nil }