Skip to content

[Backport v1.28] never let PodTemplateSpec rewrite Host Profiler seccomp init container#3145

Merged
tbavelier merged 1 commit into
v1.28from
backport-3135-to-v1.28
Jun 16, 2026
Merged

[Backport v1.28] never let PodTemplateSpec rewrite Host Profiler seccomp init container#3145
tbavelier merged 1 commit into
v1.28from
backport-3135-to-v1.28

Conversation

@dd-octo-sts

@dd-octo-sts dd-octo-sts Bot commented Jun 15, 2026

Copy link
Copy Markdown

Backport 68e2ee9 from #3135.


What does this PR do?

  • Fixes host-profiler-seccomp-setup init container using the wrong image. override.PodTemplateSpec rewrites all init container images to spec.override.nodeAgent.image, but host-profiler-seccomp-setup must use the profiler image to copy its seccomp profile, which the agent image doesn't have.
    The fix skips host-profiler-seccomp-setup in the init container rewrite loop.

  • Reverts the workaround introduced in [Host Profiler] Remove seccomp configmap and use profile baked into image #3061 (resolveHostProfilerImage reading spec.override.nodeAgent.image), which was trying to keep the hash and init container image consistent with each other around the wrong image.

Motivation

host-profiler-seccomp-setup was failing on nightly because it was running from the agent image and trying to copy a file that doesn't exist there.

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

On test cluster using main:

  1. set spec.override.nodeAgent.image
  2. observed the init container with the wrong image

Repeated these steps with fix included to confirm.

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)

#3135)

* never let podtemplate rewrite host profiler seccomp init container

* skip host Profiler container & initContainer image overrides

* remove mention of host profiler being bundled in agent image

* Align host profiler seccomp image overrides

---------

Co-authored-by: levan-m <[email protected]>
Co-authored-by: Nayef Ghattas <[email protected]>
(cherry picked from commit 68e2ee9)
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner June 15, 2026 19:25
@dd-octo-sts dd-octo-sts Bot added the bug Something isn't working label Jun 15, 2026
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner June 15, 2026 19:25
@dd-octo-sts dd-octo-sts Bot added qa/skip-qa backport label added by backport action bot label added by backport bot team/container-platform team/profiling-full-host labels Jun 15, 2026

@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: 8db0790a41

ℹ️ 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".

// Experimental image overrides are applied after ManageNodeAgent, so mirror their image
// resolution here to keep the seccomp profile and init container aligned with the final
// host-profiler container image.
hostProfilerImage := resolveHostProfilerImage(o.owner, hostProfilerContainer.Image)

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 Preserve node-agent registry for host-profiler

Here hostProfilerContainer.Image is still the pre-spec.override.nodeAgent.image value because component overrides run after ManageNodeAgent. When a deployment pins the node-agent image to a private/full registry and uses the experimental host-profiler override with name/tag, this resolves the seccomp profile/init image from the default registry instead of the overridden registry; the host-profiler container is also skipped by the later image rewrite, so the pod pulls the wrong host-profiler image in private-registry setups. Please apply the effective node-agent image override before resolving, or otherwise carry its registry into this base image.

Useful? React with 👍 / 👎.

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.

I think that's alright, we don't need to cover this edge case 👍

@datadog-official

This comment has been minimized.

@codecov-commenter

codecov-commenter commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.34%. Comparing base (1d862cd) to head (8db0790).

Files with missing lines Patch % Lines
...rnal/controller/datadogagent/experimental/image.go 0.00% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            v1.28    #3145      +/-   ##
==========================================
- Coverage   43.37%   43.34%   -0.04%     
==========================================
  Files         352      352              
  Lines       30105    30099       -6     
==========================================
- Hits        13059    13045      -14     
- Misses      16173    16181       +8     
  Partials      873      873              
Flag Coverage Δ
unittests 43.34% <55.00%> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
...oller/datadogagent/feature/hostprofiler/feature.go 80.00% <100.00%> (-2.08%) ⬇️
...oller/datadogagent/feature/hostprofiler/seccomp.go 100.00% <100.00%> (ø)
...ontroller/datadogagent/override/podtemplatespec.go 80.25% <100.00%> (+0.12%) ⬆️
...rnal/controller/datadogagent/experimental/image.go 56.25% <0.00%> (-22.02%) ⬇️

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 1d862cd...8db0790. 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 merged commit 88d9f7a into v1.28 Jun 16, 2026
66 of 67 checks passed
@tbavelier
tbavelier deleted the backport-3135-to-v1.28 branch June 16, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport label added by backport action bot label added by backport bot bug Something isn't working qa/skip-qa team/container-platform team/profiling-full-host

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants