From 486831bd86168a4c43c50c8a91aa7bf5c5a39fb7 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Fri, 10 May 2024 20:28:45 +0100 Subject: [PATCH] fix: Reverted the removal of the lifecycle hook completion (#999) Signed-off-by: Steve Hipwell --- pkg/monitor/sqsevent/asg-lifecycle-event.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/monitor/sqsevent/asg-lifecycle-event.go b/pkg/monitor/sqsevent/asg-lifecycle-event.go index a532f6e9..dede29cc 100644 --- a/pkg/monitor/sqsevent/asg-lifecycle-event.go +++ b/pkg/monitor/sqsevent/asg-lifecycle-event.go @@ -95,6 +95,11 @@ func (m SQSMonitor) asgTerminationToInterruptionEvent(event *EventBridgeEvent, m } interruptionEvent.PostDrainTask = func(interruptionEvent monitor.InterruptionEvent, _ node.Node) error { + _, err = m.continueLifecycleAction(lifecycleDetail) + if err != nil { + return fmt.Errorf("continuing ASG termination lifecycle: %w", err) + } + log.Info().Str("lifecycleHookName", lifecycleDetail.LifecycleHookName).Str("instanceID", lifecycleDetail.EC2InstanceID).Msg("Completed ASG Lifecycle Hook") return m.deleteMessage(message) }