diff --git a/cmd/node-termination-handler.go b/cmd/node-termination-handler.go index 2d8df172..f6879fa3 100644 --- a/cmd/node-termination-handler.go +++ b/cmd/node-termination-handler.go @@ -288,7 +288,7 @@ func main() { for event, ok := interruptionEventStore.GetActiveEvent(); ok; event, ok = interruptionEventStore.GetActiveEvent() { select { case interruptionEventStore.Workers <- 1: - logging.VersionedMsgs.RequestingInstanceDrain(event) + logging.VersionedMsgs.ProcessingInterruptionEvent(event) event.InProgress = true wg.Add(1) recorder.Emit(event.NodeName, observability.Normal, observability.GetReasonForKind(event.Kind, event.Monitor), event.Description) diff --git a/pkg/logging/versioned.go b/pkg/logging/versioned.go index 12b47641..95bcb72f 100644 --- a/pkg/logging/versioned.go +++ b/pkg/logging/versioned.go @@ -30,14 +30,22 @@ func (versionedMsgsV1) ProblemMonitoringForEvents(monitorKind string, err error) log.Warn().Str("event_type", monitorKind).Err(err).Msg("There was a problem monitoring for events") } -func (versionedMsgsV1) RequestingInstanceDrain(event *monitor.InterruptionEvent) { +func (versionedMsgsV1) ProcessingInterruptionEvent(event *monitor.InterruptionEvent) { + var message string + switch event.Kind { + case monitor.ASGLaunchLifecycleKind: + message = "Waiting for node to be ready before completing ASG launch lifecycle" + default: + message = "Requesting instance drain" + } + log.Info(). Str("event-id", event.EventID). Str("kind", event.Kind). Str("node-name", event.NodeName). Str("instance-id", event.InstanceID). Str("provider-id", event.ProviderID). - Msg("Requesting instance drain") + Msg(message) } func (versionedMsgsV1) SendingInterruptionEventToChannel(_ string) { @@ -54,7 +62,15 @@ func (versionedMsgsV2) ProblemMonitoringForEvents(monitorKind string, err error) log.Warn().Str("monitor_type", monitorKind).Err(err).Msg("There was a problem monitoring for events") } -func (versionedMsgsV2) RequestingInstanceDrain(event *monitor.InterruptionEvent) { +func (versionedMsgsV2) ProcessingInterruptionEvent(event *monitor.InterruptionEvent) { + var message string + switch event.Kind { + case monitor.ASGLaunchLifecycleKind: + message = "Waiting for node to be ready before completing ASG launch lifecycle" + default: + message = "Requesting instance drain" + } + log.Info(). Str("event-id", event.EventID). Str("kind", event.Kind). @@ -62,7 +78,7 @@ func (versionedMsgsV2) RequestingInstanceDrain(event *monitor.InterruptionEvent) Str("node-name", event.NodeName). Str("instance-id", event.InstanceID). Str("provider-id", event.ProviderID). - Msg("Requesting instance drain") + Msg(message) } func (versionedMsgsV2) SendingInterruptionEventToChannel(eventKind string) { @@ -72,7 +88,7 @@ func (versionedMsgsV2) SendingInterruptionEventToChannel(eventKind string) { var VersionedMsgs interface { MonitoringStarted(monitorKind string) ProblemMonitoringForEvents(monitorKind string, err error) - RequestingInstanceDrain(event *monitor.InterruptionEvent) + ProcessingInterruptionEvent(event *monitor.InterruptionEvent) SendingInterruptionEventToChannel(eventKind string) } = versionedMsgsV1{}