Skip to content

Commit 651ae77

Browse files
dd-octo-sts[bot]khewonccoignetp
authored
Add experiment signals to fleet remote config (#2872) (#2920)
* initial experiment signals * Review suggestions * [FA] Add cluster_name as tag (#2878) * Add cluster_name as tag * Add updater_type * add test logs * more logs * use installer config * Logging + race * More edge cases * Add package state pop * Fix lint * package state * Check expected state * no nsn for stop/promote * Tweak logging * Review suggestions + 2x promote fix --------- (cherry picked from commit 0dcbf67) Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com> Co-authored-by: Paul <paul.coignet@datadoghq.com>
1 parent c3d0d96 commit 651ae77

18 files changed

Lines changed: 2586 additions & 321 deletions

api/datadoghq/v2alpha1/datadogagent_types.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,13 +2395,6 @@ type ExperimentStatus struct {
23952395
// ID is the unique experiment ID sent by Fleet Automation.
23962396
// +optional
23972397
ID string `json:"id,omitempty"`
2398-
// Generation is the DDA metadata.generation recorded when the experiment started.
2399-
// Used to detect manual spec changes while the experiment is running: if the
2400-
// current DDA generation differs from this value, the operator aborts the experiment.
2401-
//
2402-
// This value must be recorded after the DDA is patched for a startExperiment signal.
2403-
// +optional
2404-
Generation int64 `json:"generation,omitempty"`
24052398
}
24062399

24072400
// DatadogAgentStatus defines the observed state of DatadogAgent.

api/datadoghq/v2alpha1/zz_generated.openapi.go

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func run(opts *options) error {
345345
}
346346

347347
if opts.remoteUpdatesEnabled {
348-
if rcErr := setupFleetDaemon(setupLog, mgr, rcUpdater.Client()); rcErr != nil {
348+
if rcErr := setupFleetDaemon(setupLog, mgr, rcUpdater.Client(), opts.createControllerRevisions && opts.datadogAgentInternalEnabled); rcErr != nil {
349349
setupErrorf(setupLog, rcErr, "Unable to setup Fleet daemon")
350350
}
351351
}
@@ -670,7 +670,7 @@ func setupAndStartHelmMetadataForwarder(logger logr.Logger, mgr manager.Manager,
670670
return mgr.Add(hmf)
671671
}
672672

673-
func setupFleetDaemon(logger logr.Logger, mgr manager.Manager, rcClient remoteconfig.RCClient) error {
674-
daemon := fleet.NewDaemon(logger.WithName("fleet"), rcClient)
673+
func setupFleetDaemon(logger logr.Logger, mgr manager.Manager, rcClient remoteconfig.RCClient, revisionsEnabled bool) error {
674+
daemon := fleet.NewDaemon(rcClient, mgr.GetClient(), revisionsEnabled)
675675
return mgr.Add(daemon)
676676
}

config/crd/bases/v1/datadoghq.com_datadogagents.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8492,15 +8492,6 @@ spec:
84928492
experiment:
84938493
description: Experiment tracks the state of an active or recent Fleet Automation experiment.
84948494
properties:
8495-
generation:
8496-
description: |-
8497-
Generation is the DDA metadata.generation recorded when the experiment started.
8498-
Used to detect manual spec changes while the experiment is running: if the
8499-
current DDA generation differs from this value, the operator aborts the experiment.
8500-
8501-
This value must be recorded after the DDA is patched for a startExperiment signal.
8502-
format: int64
8503-
type: integer
85048495
id:
85058496
description: ID is the unique experiment ID sent by Fleet Automation.
85068497
type: string

config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8194,11 +8194,6 @@
81948194
"additionalProperties": false,
81958195
"description": "Experiment tracks the state of an active or recent Fleet Automation experiment.",
81968196
"properties": {
8197-
"generation": {
8198-
"description": "Generation is the DDA metadata.generation recorded when the experiment started.\nUsed to detect manual spec changes while the experiment is running: if the\ncurrent DDA generation differs from this value, the operator aborts the experiment.\n\nThis value must be recorded after the DDA is patched for a startExperiment signal.",
8199-
"format": "int64",
8200-
"type": "integer"
8201-
},
82028197
"id": {
82038198
"description": "ID is the unique experiment ID sent by Fleet Automation.",
82048199
"type": "string"

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
github.com/DataDog/datadog-agent/pkg/config/model v0.59.0-rc.5
4343
github.com/DataDog/datadog-agent/pkg/config/remote v0.59.0-rc.5
4444
github.com/DataDog/datadog-agent/pkg/proto v0.63.0-rc.1
45-
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.5
45+
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.77.3
4646
github.com/DataDog/datadog-operator/api v0.0.0-20250130131115-7f198adcc856
4747
github.com/aws/aws-sdk-go-v2 v1.39.6
4848
github.com/aws/aws-sdk-go-v2/config v1.29.17
@@ -90,7 +90,7 @@ require (
9090
github.com/DataDog/datadog-go/v5 v5.6.0 // indirect
9191
github.com/DataDog/go-libddwaf/v3 v3.3.0 // indirect
9292
github.com/DataDog/go-sqllexer v0.0.15 // indirect
93-
github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect
93+
github.com/DataDog/go-tuf v1.1.1-0.5.2 // indirect
9494
github.com/DataDog/gostackparse v0.7.0 // indirect
9595
github.com/DataDog/sketches-go v1.4.5 // indirect
9696
github.com/DataDog/viper v1.13.5 // indirect
@@ -226,7 +226,7 @@ require (
226226
github.com/rubenv/sql-migrate v1.8.0 // indirect
227227
github.com/russross/blackfriday/v2 v2.1.0 // indirect
228228
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
229-
github.com/secure-systems-lab/go-securesystemslib v0.7.0 // indirect
229+
github.com/secure-systems-lab/go-securesystemslib v0.9.0 // indirect
230230
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
231231
github.com/shirou/gopsutil/v3 v3.24.1 // indirect
232232
github.com/shoenig/go-m1cpu v0.1.6 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ github.com/DataDog/datadog-agent/pkg/obfuscate v0.59.0-rc.5 h1:Z+vgXHXmSnVRlCpcP
8181
github.com/DataDog/datadog-agent/pkg/obfuscate v0.59.0-rc.5/go.mod h1:ATVw8kr3U1Eqz3qBz9kS6WFDKji9XyoAsHKSlj3hPTM=
8282
github.com/DataDog/datadog-agent/pkg/proto v0.63.0-rc.1 h1:5Xr7XQoINzwO0PswNKClUW4b/ZfsTefVHxTAjfMY4Qk=
8383
github.com/DataDog/datadog-agent/pkg/proto v0.63.0-rc.1/go.mod h1:QOAaPRsuM4WNXtP3Rbw+gWamge9lGnDH8ZKB6HdzoAs=
84-
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.5 h1:kCZxrxVVfbYAA8oMB4s7yb8XbO5WMkBmygcgKm3xh7o=
85-
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.5/go.mod h1:c4th0IFaP0Q1ofRa0GcPB9hJWN+cmUoEfOI1Ub0O50A=
84+
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.77.3 h1:cQvV1Qiq0EBdbGxfU4ECDJ8Nl3xYXcNUe6QzXw73pA4=
85+
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.77.3/go.mod h1:TpW5ZwsQTrlRBPjtZH5/OFwpmOqxV/v2i9BiF4Xfcac=
8686
github.com/DataDog/datadog-agent/pkg/util/backoff v0.59.0-rc.5 h1:mAXwj00h3GqpiY7yECDLwLvCOAXswx3mIiU9N6Ki1GU=
8787
github.com/DataDog/datadog-agent/pkg/util/backoff v0.59.0-rc.5/go.mod h1:2RMfdYkKyeh8hXs6WgaamkkEyK35Xo55C4rFG4dO1k8=
8888
github.com/DataDog/datadog-agent/pkg/util/cache v0.59.0-rc.5 h1:+20QEL2pI+IwOqqesjhzzWkv6GcOe3TrIgUQtg6ZdTE=
@@ -110,8 +110,8 @@ github.com/DataDog/go-libddwaf/v3 v3.3.0 h1:jS72fuQpFgJZEdEJDmHJCPAgNTEMZoz1EUvi
110110
github.com/DataDog/go-libddwaf/v3 v3.3.0/go.mod h1:Bz/0JkpGf689mzbUjKJeheJINqsyyhM8p9PDuHdK2Ec=
111111
github.com/DataDog/go-sqllexer v0.0.15 h1:rUUu52dP8EQhJLnUw0MIAxZp0BQx2fOTuMztr3vtHUU=
112112
github.com/DataDog/go-sqllexer v0.0.15/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc=
113-
github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4=
114-
github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0=
113+
github.com/DataDog/go-tuf v1.1.1-0.5.2 h1:YWvghV4ZvrQsPcUw8IOUMSDpqc3W5ruOIC+KJxPknv0=
114+
github.com/DataDog/go-tuf v1.1.1-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0=
115115
github.com/DataDog/gostackparse v0.7.0 h1:i7dLkXHvYzHV308hnkvVGDL3BR4FWl7IsXNPz/IGQh4=
116116
github.com/DataDog/gostackparse v0.7.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM=
117117
github.com/DataDog/sketches-go v1.4.5 h1:ki7VfeNz7IcNafq7yI/j5U/YCkO3LJiMDtXz9OMQbyE=
@@ -1097,8 +1097,8 @@ github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCw
10971097
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
10981098
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
10991099
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
1100-
github.com/secure-systems-lab/go-securesystemslib v0.7.0 h1:OwvJ5jQf9LnIAS83waAjPbcMsODrTQUpJ02eNLUoxBg=
1101-
github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xeGtfIqFy7Do03K4cdCY0A/GlJLDKLHI=
1100+
github.com/secure-systems-lab/go-securesystemslib v0.9.0 h1:rf1HIbL64nUpEIZnjLZ3mcNEL9NBPB0iuVjyxvq3LZc=
1101+
github.com/secure-systems-lab/go-securesystemslib v0.9.0/go.mod h1:DVHKMcZ+V4/woA/peqr+L0joiRXbPpQ042GgJckkFgw=
11021102
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
11031103
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
11041104
github.com/shirou/gopsutil/v3 v3.24.1 h1:R3t6ondCEvmARp3wxODhXMTLC/klMa87h2PHUw5m7QI=

0 commit comments

Comments
 (0)