Skip to content

Add DatadogCSIDriver controller#2844

Draft
tbavelier wants to merge 5 commits intomainfrom
tbavelier/csi-driver-standalone
Draft

Add DatadogCSIDriver controller#2844
tbavelier wants to merge 5 commits intomainfrom
tbavelier/csi-driver-standalone

Conversation

@tbavelier
Copy link
Copy Markdown
Member

What does this PR do?

  • Adds DatadogCSIDriver CRD and controller

Motivation

  • Supporting CSI driver management with operator

Additional Notes

This is best reviewed commit by commit:

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

TBD

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 and others added 5 commits April 1, 2026 11:16
Define the DatadogCSIDriver, DatadogCSIDriverSpec, DatadogCSIDriverOverride,
and DatadogCSIDriverStatus types in api/datadoghq/v1alpha1. The CRD enables
declarative management of the Datadog CSI Driver via the operator, replacing
the standalone Helm chart deployment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Controller-runtime wiring for the DatadogCSIDriver reconciler. Watches the
primary CR with GenerationChangedPredicate, owned DaemonSets for all changes
(including status), and CSIDriver objects via label-based enqueue for drift
detection on the cluster-scoped resource.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the reconciliation logic for the DatadogCSIDriver controller:
- Deferred SSA status patch with ObservedGeneration tracking
- CSIDriver object management with label-based ownership (part-of pattern)
- DaemonSet management with drift detection via generation tracking
- Override system with merge-by-name semantics (env vars, volumes, mounts)
- Image resolution via pkg/images (supports tag-only overrides)
- Finalizer-based cleanup of the cluster-scoped CSIDriver on deletion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Register the controller in setup.go with a feature flag and add the
-datadogCSIDriverEnabled flag (default: false) to cmd/main.go. Also
registers the storagev1 scheme required for CSIDriver object management.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 0.87566% with 566 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.45%. Comparing base (8f7f141) to head (600695b).

Files with missing lines Patch % Lines
internal/controller/datadogcsidriver/daemonset.go 0.00% 328 Missing ⚠️
internal/controller/datadogcsidriver/controller.go 0.00% 187 Missing ⚠️
internal/controller/datadogcsidriver/csidriver.go 0.00% 24 Missing ⚠️
internal/controller/datadogcsidriver_controller.go 0.00% 19 Missing ⚠️
internal/controller/setup.go 40.00% 6 Missing ⚠️
cmd/main.go 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2844      +/-   ##
==========================================
- Coverage   39.24%   38.45%   -0.79%     
==========================================
  Files         314      318       +4     
  Lines       27288    27859     +571     
==========================================
+ Hits        10708    10713       +5     
- Misses      15792    16358     +566     
  Partials      788      788              
Flag Coverage Δ
unittests 38.45% <0.87%> (-0.79%) ⬇️

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

Files with missing lines Coverage Δ
cmd/main.go 6.66% <33.33%> (+0.23%) ⬆️
internal/controller/setup.go 36.12% <40.00%> (+0.21%) ⬆️
internal/controller/datadogcsidriver_controller.go 0.00% <0.00%> (ø)
internal/controller/datadogcsidriver/csidriver.go 0.00% <0.00%> (ø)
internal/controller/datadogcsidriver/controller.go 0.00% <0.00%> (ø)
internal/controller/datadogcsidriver/daemonset.go 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

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

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

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