Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/node-termination-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 21 additions & 5 deletions pkg/logging/versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -54,15 +62,23 @@ 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).
Str("monitor", event.Monitor).
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) {
Expand All @@ -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{}

Expand Down