Skip to content

Commit

Permalink
Fix behaviour change with CLC defaulting (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
clamoriniere committed Aug 10, 2021
1 parent fad93d8 commit 355245f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/v1alpha1/datadogagent_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,9 @@ func DefaultExternalMetrics(conf *ClusterAgentConfig) *ExternalMetricsConfig {

extMetricsOverride := &ExternalMetricsConfig{}
if conf.ExternalMetrics.Enabled == nil {
conf.ExternalMetrics.Enabled = NewBoolPointer(defaultExternalMetricsEnabled)
// default to `true` because in that case we know that other parameters are
// present in the `conf.ExternalMetrics` struct.
conf.ExternalMetrics.Enabled = NewBoolPointer(true)
extMetricsOverride.Enabled = conf.ExternalMetrics.Enabled
}

Expand Down Expand Up @@ -1111,7 +1113,9 @@ func DefaultDatadogAgentSpecClusterChecksRunner(clusterChecksRunner *DatadogAgen

clcOverride := &DatadogAgentSpecClusterChecksRunnerSpec{}
if clusterChecksRunner.Enabled == nil {
clusterChecksRunner.Enabled = NewBoolPointer(defaultClusterChecksRunnerEnabled)
// Default to `true` because we are in the case it means other parameters
// are present in the struct.
clusterChecksRunner.Enabled = NewBoolPointer(true)
clcOverride.Enabled = clusterChecksRunner.Enabled
}

Expand Down

0 comments on commit 355245f

Please sign in to comment.