Fix misleading message for launch lifecycle events logged as drain operations #1204
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Issue #, if available:
Description of changes:
This fix resolves a message confusion where launch lifecycle events were misleadingly logged as "drain" operations when they're actually doing the opposite.
RequestingInstanceDrain()toProcessingInterruptionEvent()event.KindBefore the fix: Everything logged "Requesting instance drain"
{ "level": "info", "event": { "EventID": "asg-lifecycle-term-65343736363839362d346666352d303536352d656661622d303432326331343631666665", "Kind": "ASG_LAUNCH_LIFECYCLE", "Monitor": "SQS_MONITOR", "Description": "ASG Lifecycle Launch event received. Instance was started at 2025-10-27 12:10:53.217 +0000 UTC \n", "State": "", "AutoScalingGroupName": "on-demand-huge-workers-01-2024112121084029580000002c", "NodeName": "ip-10-31-16-222.eu-west-1.compute.internal", "NodeLabels": null, "Pods": null, "InstanceID": "i-070c03698c54561a9", "ProviderID": "aws:///eu-west-1a/i-070c03698c54561a9", "InstanceType": "", "IsManaged": true, "StartTime": "2025-10-27T12:10:53.217Z", "EndTime": "0001-01-01T00:00:00Z", "NodeProcessed": false, "InProgress": false }, "time": "2025-10-27T12:11:16Z", "message": "Adding new event to the event store" } { "level": "info", "event-id": "asg-lifecycle-term-65343736363839362d346666352d303536352d656661622d303432326331343631666665", "kind": "ASG_LAUNCH_LIFECYCLE", "node-name": "ip-10-31-16-222.eu-west-1.compute.internal", "instance-id": "i-070c03698c54561a9", "provider-id": "aws:///eu-west-1a/i-070c03698c54561a9", "time": "2025-10-27T12:11:17Z", "message": "Requesting instance drain" #<== }After the fix:
{ "level": "info", "event": { "EventID": "asg-lifecycle-term-32346536363839392d326162342d376165612d323936332d376438383166333631323932", "Kind": "ASG_LAUNCH_LIFECYCLE", "Monitor": "SQS_MONITOR", "Description": "ASG Lifecycle Launch event received. Instance was started at 2025-10-27 15:30:25.519 +0000 UTC \n", "State": "", "AutoScalingGroupName": "on-demand-huge-workers-01-2024112121084029580000002c", "NodeName": "ip-10-31-26-73.eu-west-1.compute.internal", "NodeLabels": null, "Pods": null, "InstanceID": "i-069246571a8ee057a", "ProviderID": "aws:///eu-west-1c/i-069246571a8ee057a", "InstanceType": "", "IsManaged": true, "StartTime": "2025-10-27T15:30:25.519Z", "EndTime": "0001-01-01T00:00:00Z", "NodeProcessed": false, "InProgress": false }, "time": "2025-10-27T15:30:25Z", "message": "Adding new event to the event store" } { "level": "info", "event-id": "asg-lifecycle-term-32346536363839392d326162342d376165612d323936332d376438383166333631323932", "kind": "ASG_LAUNCH_LIFECYCLE", "node-name": "ip-10-31-26-73.eu-west-1.compute.internal", "instance-id": "i-069246571a8ee057a", "provider-id": "aws:///eu-west-1c/i-069246571a8ee057a", "time": "2025-10-27T15:30:26Z", "message": "Waiting for node to be ready before completing ASG launch lifecycle" #<== }How you tested your changes:
Environment (Linux / Windows): Linux
Kubernetes Version: v1.31.13
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.