Skip to content

[CASCL-1292] Point the no-private-subnet error at all the install options#3056

Merged
L3n41c merged 1 commit into
mainfrom
lenaic/CASCL-1292-guided-no-private-subnet-error
Jun 9, 2026
Merged

[CASCL-1292] Point the no-private-subnet error at all the install options#3056
L3n41c merged 1 commit into
mainfrom
lenaic/CASCL-1292-guided-no-private-subnet-error

Conversation

@L3n41c

@L3n41c L3n41c commented May 28, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Expands the error message shown by kubectl datadog autoscaling cluster install when its default fargate mode auto-detects no private subnet in the cluster VPC. The message now names all three ways forward instead of only one:

  • add a private subnet to the cluster VPC, or
  • pass --fargate-subnets to specify them explicitly, or
  • use --install-mode=existing-nodes to deploy on existing nodes instead of Fargate.

Motivation

During QA of the Fargate mode (CASCL-1292), a tester hit the private-subnet requirement on a VPC with only public subnets. Fargate is the default mode and the requirement is a hard AWS constraint (AWS::EKS::FargateProfile only accepts private subnets). The old message mentioned only --fargate-subnets, so the tester had to discover on their own that --install-mode=existing-nodes installs with no subnet requirement at all.

Additional Notes

Deliberately minimal: a single error-message change in GetClusterPrivateSubnets plus a test update. No behavior change for successful installs.

Minimum Agent Versions

No minimum Agent/Cluster Agent version required.

Describe your test plan

  • Unit: TestGetClusterPrivateSubnets now asserts the no-subnet error mentions the private-subnet requirement, --fargate-subnets, and --install-mode=existing-nodes.
  • go test ./cmd/kubectl-datadog/autoscaling/..., make lint (0 issues), go vet, gofmt all pass.

Checklist

  • PR has at least one valid label: enhancement
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed

@codecov-commenter

codecov-commenter commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.03%. Comparing base (6b4b5f7) to head (67afd89).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3056   +/-   ##
=======================================
  Coverage   43.03%   43.03%           
=======================================
  Files         339      339           
  Lines       29215    29215           
=======================================
  Hits        12573    12573           
  Misses      15820    15820           
  Partials      822      822           
Flag Coverage Δ
unittests 43.03% <100.00%> (ø)

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

Files with missing lines Coverage Δ
...g/autoscaling/cluster/common/eks/privatesubnets.go 87.23% <100.00%> (ø)

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 6b4b5f7...67afd89. Read the comment docs.

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

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented May 28, 2026

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 43.36% (+0.00%)

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

@L3n41c
L3n41c force-pushed the lenaic/CASCL-1292-guided-no-private-subnet-error branch from c65ffa6 to 38f53bf Compare May 29, 2026 15:33
@L3n41c L3n41c changed the title [CASCL-1292] Guide users to existing-nodes mode when no private subnet is found [CASCL-1292] Point the no-private-subnet error at all the install options May 29, 2026
…ions

`autoscaling cluster install` defaults to fargate mode, which requires the
cluster VPC to have a private subnet (an AWS Fargate constraint). When
auto-detection found none, the error only mentioned `--fargate-subnets`,
leaving users unaware they could simply run on existing nodes.

Expand the message to name all three ways forward: add a private subnet, pass
`--fargate-subnets` to specify them explicitly, or use
`--install-mode=existing-nodes` to deploy on existing nodes instead of Fargate.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@L3n41c
L3n41c force-pushed the lenaic/CASCL-1292-guided-no-private-subnet-error branch from 38f53bf to 67afd89 Compare May 29, 2026 15:38
@L3n41c
L3n41c marked this pull request as ready for review June 9, 2026 08:53
@L3n41c
L3n41c requested review from a team as code owners June 9, 2026 08:53
},
expectError: true,
errorContains: "no private subnet found",
expectError: true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: expectError could be replaced with len(errorContains) > 0

@L3n41c
L3n41c merged commit c1be0e4 into main Jun 9, 2026
62 of 63 checks passed
@L3n41c
L3n41c deleted the lenaic/CASCL-1292-guided-no-private-subnet-error branch June 9, 2026 20:25
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