Add cache namespace options for DatadogCSIDriver controller#2934
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c03249ea32
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2934 +/- ##
==========================================
+ Coverage 40.69% 40.71% +0.01%
==========================================
Files 321 321
Lines 28413 28423 +10
==========================================
+ Hits 11563 11572 +9
- Misses 16015 16016 +1
Partials 835 835
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: 2c74ee7 | Docs | Datadog PR Page | Give us feedback! |
When DD_CSIDRIVER_WATCH_NAMESPACE differs from DD_AGENT_WATCH_NAMESPACE, the owned DaemonSet falls outside DefaultNamespaces, causing cache errors. Explicitly add DaemonSet to ByObject with the union of both namespace sets. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c74ee7e90
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…2940) * Add DdCSIDriver cache env var * Fix DaemonSet cache coverage for DatadogCSIDriver in separate namespace When DD_CSIDRIVER_WATCH_NAMESPACE differs from DD_AGENT_WATCH_NAMESPACE, the owned DaemonSet falls outside DefaultNamespaces, causing cache errors. Explicitly add DaemonSet to ByObject with the union of both namespace sets. --------- (cherry picked from commit f41ef99) Co-authored-by: Timothée Bavelier <[email protected]> Co-authored-by: Claude Sonnet 4.6 (1M context) <[email protected]>
What does this PR do?
Adds cache namespace configuration for the
DatadogCSIDrivercontroller, consistent with all other controllers.Introduces
DD_CSIDRIVER_WATCH_NAMESPACEenv var (falls back toWATCH_NAMESPACE), wiresDatadogCSIDriverEnabledintoconfig.CacheOptions(), and adds test coverage.Motivation
The
DatadogCSIDrivercontroller was the only controller missing its own cache namespace entry. Without it, the controller fell back toDefaultNamespaces(driven byDD_AGENT_WATCH_NAMESPACE/WATCH_NAMESPACE) instead of having its ownDD_CSIDRIVER_WATCH_NAMESPACEoverride.Additionally,
DatadogCSIDriveris unique among controllers in that it creates and reconciles a native k8sDaemonSet, which must also be accessible from the cache. If the CSIDriver is deployed in a different namespace than the agent (e.g.DD_CSIDRIVER_WATCH_NAMESPACE=default,DD_AGENT_WATCH_NAMESPACE=system), theDaemonSetfalls outsideDefaultNamespacesand causes:The fix explicitly adds
DaemonSettoByObjectwith the union of agent and CSIDriver namespaces. UsingDefaultNamespacesinstead would over-cache all other GVKs (Secrets, ConfigMaps, etc.) in the CSIDriver namespace unnecessarily.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel