aws: Skip ASG cleanup on Karpenter managed IG deletion

This commit is contained in:
Ciprian Hacman 2023-10-24 09:06:37 +03:00
parent b427cc0e43
commit 2c8a90cc73
1 changed files with 4 additions and 0 deletions

View File

@ -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 {