Skip to content

Fix GKE Autopilot registry coercion for agent profiles#3260

Merged
tbavelier merged 1 commit into
mainfrom
tbavelier/dap-autopilot-ensure-registry
Jul 15, 2026
Merged

Fix GKE Autopilot registry coercion for agent profiles#3260
tbavelier merged 1 commit into
mainfrom
tbavelier/dap-autopilot-ensure-registry

Conversation

@tbavelier

@tbavelier tbavelier commented Jul 15, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Enforces the GCR registry constraint on the final DatadogAgentInternal produced after a DatadogAgentProfile merge when GKE Autopilot is enabled.

It also adds unit coverage for profiles that configure either registry.datadoghq.com or the Datadog public ECR registry.

Motivation

GKE Autopilot registry coercion previously ran only on the base DatadogAgent copy. Profile reconciliation happens later and can replace spec.global.registry, producing an Autopilot-annotated DatadogAgentInternal with images that are rejected by the GKE workload allowlist.

Applying the constraint to the final merged object ensures every Autopilot profile uses an allowed GCR registry and that the generation hash reflects the corrected spec.

Additional Notes

This addresses the profile merge edge case identified in the review of #3254.

Minimum Agent Versions

No minimum Agent or Cluster Agent version is required.

  • Agent: N/A
  • Cluster Agent: N/A

Describe your test plan

Unit tests + on a kind/local cluster with 2 nodes+:

  • Deploy operator with profiles enabled
  • Apply a DatadogAgent manifest with registry set to registry.datadoghq.com and with the Autopilot annotation experimental.agent.datadoghq.com/autopilot: "true"
    • Note you will get error logs in the operator about not being able to apply the allowlistsynchronizer (CRD from GKE) that can be ignored
  • Apply a valid profile so you have 2 DDAIs (default + profile one)
  • Ensure each DDAI has gcr.io/datadoghq registry instead
╭─ ~/tmp/profiles                                                                                                                         󱃾 kind-local-k8s/system 13:50:27
╰─❯ k get dd datadog-agent -oyaml | yq .spec.global.registry
registry.datadoghq.com
╭─ ~/tmp/profiles                                                                                                                         󱃾 kind-local-k8s/system 13:52:39
╰─❯ k get ddai datadog-agent -oyaml | yq .spec.global.registry
gcr.io/datadoghq
╭─ ~/tmp/profiles                                                                                                                         󱃾 kind-local-k8s/system 13:52:47
╰─❯ k get ddai foo -oyaml | yq .spec.global.registry
gcr.io/datadoghq

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)

@tbavelier tbavelier added the bug Something isn't working label Jul 15, 2026 — with ChatGPT Codex Connector
@tbavelier tbavelier added this to the v1.29.0 milestone Jul 15, 2026
@datadog-datadog-prod-us1

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: 55.56% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 55.56%
Overall Coverage: 46.67% (+0.00%)

Useful? React with 👍 / 👎

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

@tbavelier
tbavelier marked this pull request as ready for review July 15, 2026 11:54
@tbavelier
tbavelier requested a review from a team July 15, 2026 11:54
@tbavelier
tbavelier merged commit 58b647b into main Jul 15, 2026
41 of 45 checks passed
@tbavelier
tbavelier deleted the tbavelier/dap-autopilot-ensure-registry branch July 15, 2026 15:23
tbavelier added a commit that referenced this pull request Jul 16, 2026
(cherry picked from commit 58b647b)

Co-authored-by: Timothée Bavelier <[email protected]>
Co-authored-by: levan-m <[email protected]>
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.

2 participants