From 2ba9c1670f152c1697367241ee9e85748ae024ac Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Fri, 18 Feb 2022 21:55:28 +0100 Subject: [PATCH] Only delete node object on GCE --- pkg/instancegroups/instancegroups.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/instancegroups/instancegroups.go b/pkg/instancegroups/instancegroups.go index 3270f1a300..9617f09524 100644 --- a/pkg/instancegroups/instancegroups.go +++ b/pkg/instancegroups/instancegroups.go @@ -409,9 +409,8 @@ func (c *RollingUpdateCluster) drainTerminateAndWait(u *cloudinstances.CloudInst } } - // We unregister the node before deleting it; if the replacement comes up with the same name it would otherwise still be cordoned - // (It often seems like GCE tries to re-use names) - if !isBastion && !c.CloudOnly { + // GCE often re-uses names, so we delete the node object to prevent the new instance from using the cordoned Node object + if c.Cluster.Spec.GetCloudProvider() == api.CloudProviderGCE && !isBastion && !c.CloudOnly { if u.Node == nil { klog.Warningf("no kubernetes Node associated with %s, skipping node deletion", instanceID) } else {