mirror of https://github.com/kubernetes/kops.git
implement aws deregister
This commit is contained in:
parent
b88d110f58
commit
117b98decb
|
@ -543,7 +543,12 @@ func (c *awsCloudImplementation) DeleteInstance(i *cloudinstances.CloudInstance)
|
|||
|
||||
// DeregisterInstance drains a cloud instance and loadbalancers.
|
||||
func (c *awsCloudImplementation) DeregisterInstance(i *cloudinstances.CloudInstance) error {
|
||||
klog.V(8).Info("AWS DeregisterInstance not implemented")
|
||||
if i.CloudInstanceGroup.InstanceGroup.Spec.Manager != kops.InstanceManagerKarpenter {
|
||||
err := deregisterInstance(c, i)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to deregister instance from loadBalancer before terminating: %v", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -553,13 +558,6 @@ 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 := deregisterInstance(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)},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue