[operator] Support host volume mount propagation config#2867
Draft
[operator] Support host volume mount propagation config#2867
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2867 +/- ##
==========================================
+ Coverage 39.24% 39.41% +0.17%
==========================================
Files 314 315 +1
Lines 27288 27395 +107
==========================================
+ Hits 10708 10797 +89
- Misses 15792 15808 +16
- Partials 788 790 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
spec.global.hostVolumeMountPropagationto the DatadogAgent CRD, enabling users to configure mount propagation on host path volume mounts. This brings the operator to parity with the Helm chart'sdatadog.hostVolumeMountPropagationsetting.Accepted values:
None,HostToContainer,Bidirectional.Motivation
Resolves CONTP-1417 — the Helm chart supports
hostVolumeMountPropagationbut the operator had no equivalent.Additional Notes
This is the simpler alternative to #2866, which threads the propagation through every feature's
GetVolumes()call (30+ files, 56 call sites). That approach treats mount propagation as a per-feature concern, but it isn't — it's a pod-level infrastructure setting that should apply uniformly to all host path mounts regardless of which feature created them.This PR instead applies mount propagation as a post-processing step after all features and overrides have built the PodTemplateSpec. This is a better fit because:
MountPropagationon mounts where it'snil, so any explicit value set viaspec.override.<component>.containers.<container>.volumeMountstakes final precedence.The implementation walks the finalized PodTemplateSpec, identifies volume mounts backed by HostPath volumes, and sets their
MountPropagationto the configured mode. This runs in both thedatadogagentanddatadogagentinternalcontroller paths (Deployment, DaemonSet, and ExtendedDaemonSet).Minimum Agent Versions
Describe your test plan
ApplyMountPropagationcovering: nil mode no-op, host-path-only targeting, preserving explicit per-mount overrides, init containers, and multi-container podsgo vet ./...passesChecklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel