-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cluster-agent defaulting to enable it by default #349
Conversation
dda352f
to
1d42c39
Compare
@@ -29,7 +29,7 @@ spec: | |||
- --enable-leader-election | |||
- --pprof | |||
image: controller:latest | |||
imagePullPolicy: Always | |||
imagePullPolicy: IfNotPresent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ease local testing
In a specific when the section "spec.clusterAgent" is not provided in the DatadogAgent instance, the cluster-agent is not defaulted to `spec.clusterAgent.enabled:true`. This change fix it, and update the tests according to this new behaviour.
1d42c39
to
4da115f
Compare
Codecov Report
@@ Coverage Diff @@
## main #349 +/- ##
===========================================
+ Coverage 38.11% 63.98% +25.86%
===========================================
Files 63 61 -2
Lines 11237 6694 -4543
===========================================
Hits 4283 4283
+ Misses 6647 2104 -4543
Partials 307 307
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -123,6 +123,7 @@ var _ = Describe("DatadogAgent Controller", func() { | |||
It("It should create DaemonSet", func() { | |||
options := &testutils.NewDatadogAgentOptions{ | |||
UseEDS: false, | |||
ClusterAgentDisabled: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to not modify the current test suite since it focus on validating Daemonset creation
@@ -17,7 +17,7 @@ import ( | |||
type NewDatadogAgentOptions struct { | |||
ExtraLabels map[string]string | |||
ExtraAnnotations map[string]string | |||
ClusterAgentEnabled bool | |||
ClusterAgentDisabled bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert Enabled to Disabled, because default is now "enabled".
What does this PR do?
Fix the default of the cluster-agent to all be defaulted to
enabled:true
.Motivation
In a specific when the section "spec.clusterAgent" is not provided
in the DatadogAgent instance, the cluster-agent is not defaulted to
spec.clusterAgent.enabled:true
.Additional Notes
N/A
Describe your test plan
Deploy the example:
datadog-agent-with-credential-secret.yaml
The cluster-agent should be deployed. Defaulting value can be also
verified by checking the value of
dataddog.status.defaultOverride.clusterAgent.enabled