(fleet) Add experiment rollout to fleet daemon#2842
Draft
Conversation
Fill the fleet daemon experiment stubs with real logic to start, stop, and promote FA experiments by patching the DDA. ## Fleet daemon (pkg/fleet/) - Add K8s client to Daemon struct for DDA operations - Add fleetManagementOperation type per installer config RFC - Add Operations field to installerConfig (alongside legacy FileOperations) - startDatadogAgentExperiment: extract config, apply JSON merge patch to DDA spec, set experiment status with post-patch generation - stopDatadogAgentExperiment: set phase=stopped (with ID validation) - promoteDatadogAgentExperiment: set phase=promoted (with ID validation) - Guards: reject start during active experiment, allow after terminal phases (aborted/timeout/promoted), silently drop stale stop/promote - setExperimentStatus with conflict retry (3x re-fetch) - testing.go: test-friendly exports for CLI and integration tests ## CRD types - ExperimentStatus: phase, id, generation (aligned with Caroline RFC) - ExperimentPhase enum: running, stopped, rollback, timeout, promoted, aborted - Add Experiment field to DatadogAgentStatus ## Reconciler compatibility - generateNewStatusFromDDA preserves Experiment via DeepCopy - IsEqualStatus compares Experiment field ## Test CLI (cmd/fleet-test/) - Exercises daemon code against real K8s API server - Supports: start, stop, promote, status actions - Verified on workspace Kind cluster ## Unit tests (13 new) - extractDDAPatch: success, no match - start: success, missing config, missing ID, DDA not found, already running, after aborted, merge patch preserves fields - stop: running, no running, ID mismatch - promote: running, no running Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Fill the fleet daemon experiment stubs with real logic to start, stop, and promote FA experiments by patching the DDA.
Fleet daemon (pkg/fleet/)
CRD types
Reconciler compatibility
Test CLI (cmd/fleet-test/)
Unit tests (13 new)
What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
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?
Describe your test plan
Write there any instructions and details you may have to test your PR.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel