Skip to content

[CASCL-1386] (6/11) Extract shared EC2 instance-ID helper to common/aws#3173

Merged
L3n41c merged 7 commits into
mainfrom
lenaic/CASCL-1386-evict-06-ec2-instance-id-helper
Jun 29, 2026
Merged

[CASCL-1386] (6/11) Extract shared EC2 instance-ID helper to common/aws#3173
L3n41c merged 7 commits into
mainfrom
lenaic/CASCL-1386-evict-06-ec2-instance-id-helper

Conversation

@L3n41c

@L3n41c L3n41c commented Jun 18, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Extracts EC2 provider-ID parsing into a shared commonaws.ExtractEC2InstanceID helper and reuses it from classify and fromnodes, removing the duplicated regex.

Motivation

PR #3026 is too large to review as a single change. This is part 6 of 11 of a stack that splits it into small, individually-reviewable pieces that each build and pass tests on their own. See #3026 for the full feature context and end-to-end QA.

Additional Notes

Stacked PR — the base branch is lenaic/CASCL-1386-evict-05-cluster-autoscaler, not main, so the diff shows only this step's change. Self-contained refactor used by later eviction parts. The code is taken verbatim from #3026 (rebased onto main); there are no logic changes versus #3026.

Minimum Agent Versions

N/A — kubectl-datadog plugin only.

Describe your test plan

go test ./cmd/kubectl-datadog/autoscaling/cluster/... passes at this commit. Full end-to-end QA is tracked on #3026.

Checklist

@codecov-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.05%. Comparing base (1ed7ac0) to head (0f3bbd1).

Files with missing lines Patch % Lines
.../autoscaling/cluster/common/karpenter/fromnodes.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                                Coverage Diff                                @@
##           lenaic/CASCL-1386-evict-05-cluster-autoscaler    #3173      +/-   ##
=================================================================================
+ Coverage                                          44.04%   44.05%   +0.01%     
=================================================================================
  Files                                                388      389       +1     
  Lines                                              31087    31093       +6     
=================================================================================
+ Hits                                               13692    13698       +6     
  Misses                                             16501    16501              
  Partials                                             894      894              
Flag Coverage Δ
unittests 44.05% <75.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ctl-datadog/autoscaling/cluster/common/aws/node.go 100.00% <100.00%> (ø)
...autoscaling/cluster/common/clusterinfo/classify.go 88.46% <100.00%> (-0.07%) ⬇️
.../autoscaling/cluster/common/karpenter/fromnodes.go 11.93% <0.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ed7ac0...0f3bbd1. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@datadog-official

datadog-official Bot commented Jun 18, 2026

Copy link
Copy Markdown

Code Coverage

Fix all issues with BitsAI

🛑 Gate Violations

🎯 1 Code Coverage issue detected

A Patch coverage percentage gate may be blocking this PR.

Patch coverage: 72.73% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 72.73%
Overall Coverage: 45.01% (+0.01%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f33a8bb | Docs | Datadog PR Page | Give us feedback!

@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-05-cluster-autoscaler branch from dfa2be6 to 1303499 Compare June 19, 2026 14:21
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-06-ec2-instance-id-helper branch from dd81350 to 0f545f7 Compare June 19, 2026 14:21
Part of a stack splitting #3026 (too large to review in one piece) into
small pieces that each build and pass tests on their own. The command is
fully functional only once the whole stack lands.
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-05-cluster-autoscaler branch from 1303499 to 4a328cf Compare June 22, 2026 13:25
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-06-ec2-instance-id-helper branch from 0f545f7 to 3b7cda6 Compare June 22, 2026 13:25
Part of a stack splitting #3026 (too large to review in one piece) into
small pieces that each build and pass tests on their own. The command is
fully functional only once the whole stack lands.
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-05-cluster-autoscaler branch from 4a328cf to 05481ca Compare June 23, 2026 08:49
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-06-ec2-instance-id-helper branch from 3b7cda6 to 06f31c4 Compare June 23, 2026 08:49
Part of a stack splitting #3026 (too large to review in one piece) into
small pieces that each build and pass tests on their own. The command is
fully functional only once the whole stack lands.
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-05-cluster-autoscaler branch from 05481ca to ce64343 Compare June 25, 2026 08:18
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-06-ec2-instance-id-helper branch 2 times, most recently from 91c9a7b to 0f3bbd1 Compare June 26, 2026 12:16
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-05-cluster-autoscaler branch from ce64343 to 1ed7ac0 Compare June 26, 2026 12:16
L3n41c and others added 3 commits June 26, 2026 16:42
Part of a stack splitting #3026 (too large to review in one piece) into
small pieces that each build and pass tests on their own. The command is
fully functional only once the whole stack lands.
…-nodes

Part of a stack splitting #3026 (too large to review in one piece) into
small pieces that each build and pass tests on their own. The command is
fully functional only once the whole stack lands.
Part of a stack splitting #3026 (too large to review in one piece) into
small pieces that each build and pass tests on their own. The command is
fully functional only once the whole stack lands.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-06-ec2-instance-id-helper branch from 0f3bbd1 to e69973f Compare June 26, 2026 14:45
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1386-evict-05-cluster-autoscaler branch from 1ed7ac0 to 563df65 Compare June 26, 2026 14:45
Base automatically changed from lenaic/CASCL-1386-evict-05-cluster-autoscaler to main June 29, 2026 12:15
@L3n41c
L3n41c marked this pull request as ready for review June 29, 2026 12:40
@L3n41c
L3n41c requested review from a team as code owners June 29, 2026 12:40
@L3n41c
L3n41c merged commit b38bcfe into main Jun 29, 2026
38 of 39 checks passed
@L3n41c
L3n41c deleted the lenaic/CASCL-1386-evict-06-ec2-instance-id-helper branch June 29, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants