From 2c8a90cc73ac04d3e8364458c2e5a9953d68dc23 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Tue, 24 Oct 2023 09:06:37 +0300 Subject: [PATCH] aws: Skip ASG cleanup on Karpenter managed IG deletion --- upup/pkg/fi/cloudup/awsup/aws_cloud.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upup/pkg/fi/cloudup/awsup/aws_cloud.go b/upup/pkg/fi/cloudup/awsup/aws_cloud.go index 97587f3c428af..9d49bcd25bd16 100644 --- a/upup/pkg/fi/cloudup/awsup/aws_cloud.go +++ b/upup/pkg/fi/cloudup/awsup/aws_cloud.go @@ -501,6 +501,10 @@ func NewEC2Filter(name string, values ...string) *ec2.Filter { // DeleteGroup deletes an aws autoscaling group func (c *awsCloudImplementation) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error { + if g.InstanceGroup != nil && g.InstanceGroup.Spec.Manager == kops.InstanceManagerKarpenter { + return nil + } + if c.spotinst != nil { if featureflag.SpotinstHybrid.Enabled() { if _, ok := g.Raw.(*autoscaling.Group); ok {