mirror of https://github.com/kubernetes/kops.git
Do not try to deregister karpenter nodes from ELBs
This commit is contained in:
parent
5e944f1a15
commit
fab77b45ee
|
@ -546,10 +546,12 @@ func deleteInstance(c AWSCloud, i *cloudinstances.CloudInstance) error {
|
|||
return fmt.Errorf("id was not set on CloudInstance: %v", i)
|
||||
}
|
||||
|
||||
if i.CloudInstanceGroup.InstanceGroup.Spec.Manager != kops.InstanceManagerKarpenter {
|
||||
err := deregisterInstanceFromClassicLoadBalancer(c, i)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to deregister instance from loadBalancer before terminating: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
request := &ec2.TerminateInstancesInput{
|
||||
InstanceIds: []*string{aws.String(id)},
|
||||
|
@ -576,7 +578,6 @@ func deregisterInstanceFromClassicLoadBalancer(c AWSCloud, i *cloudinstances.Clo
|
|||
asgDetails, err := c.Autoscaling().DescribeAutoScalingGroups(&autoscaling.DescribeAutoScalingGroupsInput{
|
||||
AutoScalingGroupNames: []*string{asg.AutoScalingGroupName},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("error describing autoScalingGroups: %v", err)
|
||||
}
|
||||
|
@ -599,7 +600,6 @@ func deregisterInstanceFromClassicLoadBalancer(c AWSCloud, i *cloudinstances.Clo
|
|||
InstanceId: aws.String(i.ID),
|
||||
}},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("error describing instance health: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue