[CASCL-338] kubectl datadog autoscaling dpa: wait without list, validate container names #3680
All Vouch review confidence checks passed
Residual risk 0.39 = Change Risk (0.70) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.70 · 306 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.343
Sensitive Paths
sensitive_paths
0.070
Real PR Conversation Timeline
1 comments
"Review active on #3680"
general
weight: 0.35
clamoriniere
What does this PR do?
Fixes the two Codex findings raised on the v1.32 backport #3677 of #3558, in the
kubectl datadog autoscaling dpacommands:list(dpa/common/command.go): the status wait after patching listed every DatadogPodAutoscaler in the namespace. DPAs selected by name (without-A) are now read withGet. Deleted objects are skipped, as before. Selections by-l,--allor-Astill use oneListper namespace.dpa/forceresources/value.go):force-resources set -caccepted any non-empty name (bad name,APP). Container names are now validated as DNS-1123 labels, both for--container(before connecting to the cluster) and for the current annotation value.Motivation
get/patchon named DPAs only (resourceNames), the patch succeeded, but the wait could not list. The command then waited until the timeout and exited non-zero, even though the override was applied.Additional Notes
setfor that object, andunset -cfor it. The error already says to rununsetwithout-c, which removes the whole annotation.Minimum Agent Versions
No change.
Describe your test plan
TestWaitForConfirmationGetsNamedObjects: withListforbidden, a named selection is confirmed throughGet, and a deleted object is ignored. Names with-Astill useList. The test fails without the fix.TestParseValueMatchesTheAgentandTestSetValidatesFlags.go test ./cmd/kubectl-datadog/autoscaling/...andgo vetpass locally. golangci-lint was not run locally, so it is left to CI.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
🤖 PR description and code assisted by Claude:claude-opus-5-5