[CASCL-1304] Add e2e assertion for dd-cluster-info ConfigMap#3025
[CASCL-1304] Add e2e assertion for dd-cluster-info ConfigMap#3025L3n41c wants to merge 2 commits into
dd-cluster-info ConfigMap#3025Conversation
Add a `Verify dd-cluster-info ConfigMap` sub-test to TestAutoscalingDefault that fetches the ConfigMap written by `kubectl datadog autoscaling cluster install`, unmarshals its YAML payload, and asserts every deterministic field of the snapshot: APIVersion, ClusterName, ClusterARN (regex), Region, GeneratedAt freshness, the two EKS managed node groups, the install-time `dd-karpenter-<cluster>` Fargate profile flagged as ManagedByDatadog, the Datadog-managed NodePools, and the Autoscaling block reporting the freshly installed Karpenter as the only autoscaler. The full YAML payload is logged so CI failures are debuggable from logs. The wire-format struct is duplicated rather than imported to keep the e2e test module free of controller-runtime, karpenter, and the AWS autoscaling SDK transitive dependencies. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dd-cluster-info ConfigMap
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3025 +/- ##
=======================================
Coverage 41.50% 41.50%
=======================================
Files 335 335
Lines 28714 28714
=======================================
Hits 11919 11919
Misses 16001 16001
Partials 794 794
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: fad64b6 | Docs | Datadog PR Page | Give us feedback! |
The initial CI run surfaced that Pulumi's DisplayName truncates the linux-arm node group name to `linux-a-n` once the cluster name consumes most of the 37-char prefix budget, breaking the substring check. Replace the linux/linux-arm distinction with structural assertions that hold regardless of the truncation: - EKS managed node group bucket: 2 entries, each with exactly 1 node (DesiredSize=1) matching the kubelet AWS hostname pattern. - Fargate bucket: 2 entries — the harness' own profile and the install-time `dd-karpenter-<cluster>`; only the latter is ManagedByDatadog; both carry at least one `fargate-ip-…` node. - Karpenter bucket: 2 NodePools `dd-karpenter-*`, ManagedByDatadog, with empty Nodes lists (the snapshot is written at install time, before Karpenter has provisioned its first node). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
What does this PR do?
Adds a
Verify dd-cluster-info ConfigMapsub-test toTestAutoscalingDefaultin
test/e2e/tests/autoscaling_suite/autoscaling_test.go. The sub-testfetches the
dd-cluster-infoConfigMap thatkubectl datadog autoscaling cluster installwrites in thedd-karpenternamespace, unmarshals its YAML payload, and asserts every deterministic
field of the snapshot:
app.kubernetes.io/managed-bylabel, data key).on
s.clusterName), Region, and a 30-minute freshness bound onGeneratedAt.NodeManagement.eksManagedNodeGroupcontains exactly two entries whosenames match the
linuxandlinux-armpatterns provisioned by thee2e-framework.
NodeManagement.fargatecontains the install-timedd-karpenter-<cluster>profile, flagged as
ManagedByDatadog.NodeManagement.karpenteris non-empty and every entry has thedd-karpenter-name prefix andManagedByDatadog: true.Autoscaling.ClusterAutoscaler.Present == false,EKSAutoMode.Enabled == false,and Karpenter is present in
dd-karpenter, namedkarpenter, withManagedByDatadog, a populatedInstallerVersion, and a SemVer-shapedVersion.The full YAML payload is logged unconditionally so any assertion failure
can be debugged from CI logs alone.
Motivation
PRs #2945 and #2980 introduced the
dd-cluster-infoConfigMap as the source of truth consumed by thefollow-up Karpenter migration tool. No e2e coverage was asserting that
the ConfigMap actually gets written with the expected shape after a real
install on EKS. This adds that coverage as a sub-test of the existing
default install flow, so it shares the cluster provisioning and install
steps with the other autoscaling tests — no extra infrastructure cost.
Jira: CASCL-1304.
Additional Notes
The
dd-cluster-infopayload is unmarshaled into a locally-definedwire-format struct rather than importing the producer's
cmd/kubectl-datadog/autoscaling/cluster/common/clusterinfopackage, toavoid pulling controller-runtime, karpenter, and the AWS autoscaling SDK
transitive dependencies into the e2e test module. The duplication is
documented and kept minimal.
Minimum Agent Versions
No agent-side change.
Describe your test plan
the EKS GitLab job; no new pipeline wiring required.
go vet,go build, and golangci-lintfor the
test/e2emodule.t.Logfso any future fielddrift surfaces directly in CI logs.
Checklist
enhancementqa/skip-qalabel (qa/skip-qa: this istest-only and doesn't affect user-facing behavior)