Skip to content

[CASCL-1386] (1/11) Add evict-legacy-nodes command skeleton#3160

Merged
L3n41c merged 1 commit into
mainfrom
lenaic/CASCL-1386-evict-01-skeleton
Jun 25, 2026
Merged

[CASCL-1386] (1/11) Add evict-legacy-nodes command skeleton#3160
L3n41c merged 1 commit into
mainfrom
lenaic/CASCL-1386-evict-01-skeleton

Conversation

@L3n41c

@L3n41c L3n41c commented Jun 18, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Introduces the kubectl datadog autoscaling cluster evict-legacy-nodes cobra subcommand: flag parsing, validation and the full run.go orchestration. The feature logic it drives is stubbed and implemented by the rest of the stack.

Motivation

PR #3026 is too large to review as a single change. This is part 1 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

Functions implemented later in the stack are stubbed with panic("TODO …"), so the command compiles and its orchestration is unit-tested but is not yet end-to-end functional. 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

@datadog-prod-us1-3

datadog-prod-us1-3 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: 5.16% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 5.16%
Overall Coverage: 43.98% (-0.30%)

Useful? React with 👍 / 👎

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

@L3n41c L3n41c force-pushed the lenaic/CASCL-1386-evict-01-skeleton branch from 1ea5ce0 to 2491129 Compare June 18, 2026 15:41
@L3n41c L3n41c changed the title [CASCL-1386] (1/12) Add evict-legacy-nodes command skeleton [CASCL-1386] (1/11) Add evict-legacy-nodes command skeleton Jun 18, 2026
@codecov-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.48523% with 224 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.74%. Comparing base (92788bf) to head (a97a49e).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...d/kubectl-datadog/autoscaling/cluster/evict/run.go 11.71% 98 Missing ⚠️
...kubectl-datadog/autoscaling/cluster/evict/evict.go 0.00% 80 Missing ⚠️
.../kubectl-datadog/autoscaling/cluster/evict/plan.go 0.00% 25 Missing ⚠️
...d/kubectl-datadog/autoscaling/cluster/evict/pdb.go 0.00% 4 Missing ⚠️
...ubectl-datadog/autoscaling/cluster/evict/prompt.go 0.00% 4 Missing ⚠️
...d/kubectl-datadog/autoscaling/cluster/evict/asg.go 0.00% 2 Missing ⚠️
...dog/autoscaling/cluster/evict/clusterautoscaler.go 0.00% 2 Missing ⚠️
...bectl-datadog/autoscaling/cluster/evict/eks_mng.go 0.00% 2 Missing ⚠️
...atadog/autoscaling/cluster/evict/karpenter_user.go 0.00% 2 Missing ⚠️
...ctl-datadog/autoscaling/cluster/evict/preflight.go 0.00% 2 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3160      +/-   ##
==========================================
- Coverage   44.03%   43.74%   -0.30%     
==========================================
  Files         377      388      +11     
  Lines       30713    30950     +237     
==========================================
+ Hits        13525    13538      +13     
- Misses      16300    16524     +224     
  Partials      888      888              
Flag Coverage Δ
unittests 43.74% <5.48%> (-0.30%) ⬇️

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

Files with missing lines Coverage Δ
cmd/kubectl-datadog/autoscaling/cluster/cluster.go 0.00% <0.00%> (ø)
...d/kubectl-datadog/autoscaling/cluster/evict/asg.go 0.00% <0.00%> (ø)
...dog/autoscaling/cluster/evict/clusterautoscaler.go 0.00% <0.00%> (ø)
...bectl-datadog/autoscaling/cluster/evict/eks_mng.go 0.00% <0.00%> (ø)
...atadog/autoscaling/cluster/evict/karpenter_user.go 0.00% <0.00%> (ø)
...ctl-datadog/autoscaling/cluster/evict/preflight.go 0.00% <0.00%> (ø)
...tl-datadog/autoscaling/cluster/evict/standalone.go 0.00% <0.00%> (ø)
...d/kubectl-datadog/autoscaling/cluster/evict/pdb.go 0.00% <0.00%> (ø)
...ubectl-datadog/autoscaling/cluster/evict/prompt.go 0.00% <0.00%> (ø)
.../kubectl-datadog/autoscaling/cluster/evict/plan.go 0.00% <0.00%> (ø)
... and 2 more

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 92788bf...a97a49e. Read the comment docs.

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

@L3n41c L3n41c force-pushed the lenaic/CASCL-1386-evict-01-skeleton branch from 2491129 to 66cb71f 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-01-skeleton branch from 66cb71f to a97a49e Compare June 22, 2026 13:24
@L3n41c L3n41c marked this pull request as ready for review June 22, 2026 13:28
@L3n41c L3n41c requested review from a team as code owners June 22, 2026 13:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a97a49eb24

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/kubectl-datadog/autoscaling/cluster/evict/run.go
@L3n41c L3n41c merged commit 847d0dd into main Jun 25, 2026
142 of 144 checks passed
@L3n41c L3n41c deleted the lenaic/CASCL-1386-evict-01-skeleton branch June 25, 2026 09:00
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