Skip to content

Refactor GKE Autopilot support to use capabilities framework#3137

Merged
levan-m merged 9 commits into
mainfrom
levan-m/autopilot-refactor
Jul 6, 2026
Merged

Refactor GKE Autopilot support to use capabilities framework#3137
levan-m merged 9 commits into
mainfrom
levan-m/autopilot-refactor

Conversation

@levan-m

@levan-m levan-m commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

CONTP-1743

Refactoring, should be non-functional change.
9842240 adds golden files for Operator generated k8s resources (besides allowlist). comprehensive-dda.yaml isn't working on actual Autopilot.
eb4c2c7 actual refactor including golden file diffs which are no-ops just several rearranged env vars.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

https://github.com/DataDog/datadog-operator/blob/main/docs/gke_autopilot/external.md

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@levan-m levan-m added this to the v1.29.0 milestone Jun 12, 2026
@levan-m
levan-m requested a review from a team June 12, 2026 17:12
@levan-m
levan-m requested review from a team as code owners June 12, 2026 17:12
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Coverage

Fix all issues with BitsAI

🛑 Gate Violations

🎯 1 Code Coverage issue detected

A Patch coverage percentage gate may be blocking this PR.

Patch coverage: 58.49% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 58.49%
Overall Coverage: 45.15% (+0.14%)

Useful? React with 👍 / 👎

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb4c2c75fc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


// Apply provider-conditional global (default-layer) mutations. Runs after
// global settings.
global.ApplyGlobalNodeAgentSpec(podManagers, provider)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reapply Autopilot stripping after nodeAgent overrides

When GKE Autopilot is enabled and a user has a nodeAgent override that adds one of the volumes or mounts Autopilot strips (for example runtimesocketdir or datadog-agent-auth), this call now runs before the override loop below, so the later override.PodTemplateSpec call reintroduces forbidden hostPath/auth mounts into the rendered DaemonSet. Previously the experimental Autopilot override ran after nodeAgent overrides and stripped those entries, so existing Autopilot specs could still render pods accepted by the WorkloadAllowlist. Please move or reapply the Autopilot removals after nodeAgent overrides, and mirror the ordering fix in the ExtendedDaemonSet branch.

Useful? React with 👍 / 👎.

@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.62712% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.92%. Comparing base (3748b72) to head (c71106e).

Files with missing lines Patch % Lines
...ller/datadogagent/feature/logcollection/feature.go 0.00% 13 Missing ⚠️
...ntroller/datadogagent/feature/dogstatsd/feature.go 0.00% 5 Missing ⚠️
...datadogagentinternal/controller_reconcile_agent.go 0.00% 4 Missing ⚠️
internal/controller/datadogagent/ddai.go 50.00% 1 Missing and 1 partial ⚠️
.../controller/datadogagent/experimental/autopilot.go 66.66% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (57.62%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3137      +/-   ##
==========================================
- Coverage   43.96%   43.92%   -0.05%     
==========================================
  Files         377      378       +1     
  Lines       30774    30711      -63     
==========================================
- Hits        13530    13490      -40     
+ Misses      16327    16312      -15     
+ Partials      917      909       -8     
Flag Coverage Δ
unittests 43.92% <57.62%> (-0.05%) ⬇️

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

Files with missing lines Coverage Δ
...l/controller/datadogagent/global/provider_apply.go 100.00% <100.00%> (ø)
...er/datadogagentinternal/controller_reconcile_v2.go 0.00% <ø> (ø)
pkg/kubernetes/provider.go 86.36% <ø> (ø)
.../controller/datadogagent/experimental/autopilot.go 31.81% <66.66%> (-25.85%) ⬇️
internal/controller/datadogagent/ddai.go 65.07% <50.00%> (-1.03%) ⬇️
...datadogagentinternal/controller_reconcile_agent.go 4.03% <0.00%> (ø)
...ntroller/datadogagent/feature/dogstatsd/feature.go 72.72% <0.00%> (-2.28%) ⬇️
...ller/datadogagent/feature/logcollection/feature.go 72.63% <0.00%> (-11.52%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3748b72...c71106e. Read the comment docs.

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

@tbavelier tbavelier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Autopilot part looks great, thank you, this is much clearer than previous, great framework.
Could we move the un-related files out of this PR in a different one, e.g. comprehensive-aks, eks, etc. ?

@levan-m
levan-m merged commit c97788f into main Jul 6, 2026
37 of 38 checks passed
@levan-m
levan-m deleted the levan-m/autopilot-refactor branch July 6, 2026 13:53
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