Skip to content

Commit

Permalink
fix: Reverted the removal of the lifecycle hook completion
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Hipwell <[email protected]>
  • Loading branch information
stevehipwell committed May 10, 2024
1 parent 87b8ffe commit d67783c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/monitor/sqsevent/asg-lifecycle-event.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d67783c

Please sign in to comment.