[Backport v1.31] [CASCL-1786] Treat any ResourceNotFoundException as no Pod Identity addon #3564
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 427 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3564"
general
weight: 0.35
AlexanderYastrebov
Backport ddb93850efa6c3d8cf8b8d3d39f32745b09a2ed5 from #3560.
___
What does this PR do?
IsThereUnmanagedEKSPodIdentityAgentInstallednow treats anyResourceNotFoundExceptionfromeks:DescribeAddonas "no unmanagedeks-pod-identity-agentaddon", instead of requiring one exact error message.It also takes a small
DescribeAddonAPIinterface (like the neighbouringOIDCProviderAPIandDescribeRouteTablesAPI) so the behaviour can be unit tested, and reports an empty response as an error instead of wrapping a nil error.Motivation
kubectl datadog autoscaling cluster install --install-mode=existing-nodesfails on any cluster that does not already have the Pod Identity addon. The check only treated the 404 as "no addon" when the message containedNo addon: eks-pod-identity-agent found in cluster, and EKS now answersThe requested resource does not exist.The install then stops with:and leaves the first CloudFormation stack (
dd-karpenter-<cluster>-karpenter) behind. This is not a regression in the plugin: the matching code dates from #2301 and is unchanged since. The template creates the addon itself when it is missing, so "not found" is the normal case.It is also why
TestAutoscalingInstallModeExistingNodesfails in thee2e_autoscalingjob (seen on 2026-09-25, 2026-09-28 and 2026-10-06). That job only runs automatically on PRs that touch the autoscaling paths, so nothing exercised the code in between.Fixes CASCL-1786.
Additional Notes
createCloudFormationStacksdescribes the cluster before it looks for the addon, so it cannot be mistaken for a missing addon here.cloudformation.go, for a missing stack and for "No updates are to be performed"). They look at CloudFormation's own well-known messages and are not changed here.Minimum Agent Versions
Not applicable: this only changes the
kubectl-datadogplugin.Describe your test plan
podidentityagent_test.gocover: addon not installed (the message EKS returns today, the legacy message, and an untyped API error carrying the not-found code), unmanaged addon installed, addon tagged by another tool, addon installed by kubectl-datadog, an unrelated API error, a non-API error, and an empty response. With the old message check put back, the first and third "not installed" cases fail.go test ./cmd/kubectl-datadog/autoscaling/...andgolangci-lintpass locally.TestAutoscalingInstallModeExistingNodesin thee2e_autoscalingjob covers the end-to-end path.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
🤖 Generated with Claude Code