Skip to content

Add EKS auto-mode pre-flight check to kubectl plugin install command#2717

Merged
L3n41c merged 1 commit into
mainfrom
lenaic/kubectl-plugin-eks-automode-preflight
Mar 10, 2026
Merged

Add EKS auto-mode pre-flight check to kubectl plugin install command#2717
L3n41c merged 1 commit into
mainfrom
lenaic/kubectl-plugin-eks-automode-preflight

Conversation

@L3n41c

@L3n41c L3n41c commented Mar 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Detect EKS auto-mode before installing Karpenter by checking for the nodeclasses CRD in the eks.amazonaws.com API group via the Kubernetes discovery API
  • When auto-mode is active, skip the entire Karpenter installation and display a message directing the user to the Datadog autoscaling settings page
  • Factor out the URL construction/browser logic into a shared openAutoscalingSettingsURL helper

Test plan

  • Unit tests for IsEKSAutoModeEnabled (auto-mode active, group not found, group exists without nodeclasses)
  • go build ./cmd/kubectl-datadog/...
  • Manual test on an EKS cluster with auto-mode enabled
  • Manual test on an EKS cluster without auto-mode (should proceed with install as before)

Detect EKS auto-mode by checking for the nodeclasses CRD in the
eks.amazonaws.com API group before installing Karpenter. When auto-mode
is active, Karpenter is already built-in and does not need a separate
installation — display a message directing the user to the Datadog
autoscaling settings page instead.
@L3n41c L3n41c added the enhancement New feature or request label Mar 6, 2026
@L3n41c L3n41c added this to the v1.25.0 milestone Mar 6, 2026
@codecov-commenter

codecov-commenter commented Mar 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.66667% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.26%. Comparing base (f52c174) to head (a26bed7).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ctl-datadog/autoscaling/cluster/install/install.go 0.00% 21 Missing ⚠️
...g/autoscaling/cluster/install/guess/eksautomode.go 88.88% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2717      +/-   ##
==========================================
+ Coverage   38.81%   39.26%   +0.44%     
==========================================
  Files         307      309       +2     
  Lines       26610    27272     +662     
==========================================
+ Hits        10329    10707     +378     
- Misses      15501    15771     +270     
- Partials      780      794      +14     
Flag Coverage Δ
unittests 39.26% <26.66%> (+0.44%) ⬆️

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

Files with missing lines Coverage Δ
...g/autoscaling/cluster/install/guess/eksautomode.go 88.88% <88.88%> (ø)
...ctl-datadog/autoscaling/cluster/install/install.go 15.18% <0.00%> (-1.33%) ⬇️

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f52c174...a26bed7. 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 commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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".

@L3n41c
L3n41c marked this pull request as ready for review March 9, 2026 09:18
@L3n41c
L3n41c requested a review from a team March 9, 2026 09:18
@L3n41c
L3n41c requested review from a team as code owners March 9, 2026 09:18
@L3n41c
L3n41c merged commit a577ddc into main Mar 10, 2026
64 of 68 checks passed
@L3n41c
L3n41c deleted the lenaic/kubectl-plugin-eks-automode-preflight branch March 10, 2026 10:09
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.

5 participants