Skip to content
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

Support extra Orchestrator-Explorer configuration and clusterchecks #348

Merged
merged 2 commits into from
Aug 6, 2021

Conversation

clamoriniere
Copy link
Collaborator

What does this PR do?

  • Update DatadogAgent CRD to allow custom configuration for the
    Orchestrator-Explorer feature.
  • Create dedicated RBAC for the cluster-check-runners.
  • Fix several controllers issues.

Motivation

Better support complex deployment with the Orchestrator-Explorer
scheduled as cluster-check

Additional Notes

N/A

Describe your test plan

Deploy the agent with the example datadog-agent-orchestrator-custom-conf.yaml.
You can modify it a bit to remove the spec.features.orchestratorExplorer.conf
section and see that the configuration is updated and the DCA is restarted... to
pick-up the new configuration

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, documentation

@clamoriniere clamoriniere force-pushed the clamoriniere/orchestrator-clusterchecks branch from 2eea21d to eb3670e Compare August 4, 2021 13:16
@@ -428,7 +437,7 @@ func TestDefaultDatadogAgentSpecAgent(t *testing.T) {
},
},
{
name: "sparse config",
name: "agent spec sparse config",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have renamed it because two tests had the same name.

internal *OrchestratorExplorerConfig
name string
orc *DatadogFeatures
clustercheck bool
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have introduced the clustercheck to keep the tests working as they were.

@@ -22,7 +22,7 @@ func IsValidDatadogAgent(spec *DatadogAgentSpec) error {
}
}

if spec.Agent.SystemProbe.CustomConfig != nil {
if spec.Agent.SystemProbe != nil && spec.Agent.SystemProbe.CustomConfig != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix panic

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2021

Codecov Report

Merging #348 (2eea21d) into main (1e43add) will increase coverage by 26.26%.
The diff coverage is 71.93%.

❗ Current head 2eea21d differs from pull request most recent head eb3670e. Consider uploading reports for the commit eb3670e to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##             main     #348       +/-   ##
===========================================
+ Coverage   38.11%   64.37%   +26.26%     
===========================================
  Files          63       62        -1     
  Lines       11237     6878     -4359     
===========================================
+ Hits         4283     4428      +145     
+ Misses       6647     2134     -4513     
- Partials      307      316        +9     
Flag Coverage Δ
unittests 64.37% <71.93%> (+26.26%) ⬆️

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

Impacted Files Coverage Δ
api/v1alpha1/datadogagent_types.go 100.00% <ø> (ø)
api/v1alpha1/datadogagent_validation.go 0.00% <0.00%> (ø)
controllers/datadogagent/controller.go 51.80% <25.00%> (ø)
...ntrollers/datadogagent/clusterchecksrunner_rbac.go 50.94% <52.00%> (-13.16%) ⬇️
controllers/datadogagent/orchestrator.go 67.24% <67.24%> (ø)
controllers/datadogagent/kubestatemetrics.go 85.47% <75.00%> (+0.08%) ⬆️
controllers/datadogagent/clusteragent.go 72.24% <78.08%> (+1.79%) ⬆️
api/v1alpha1/datadogagent_default.go 83.51% <100.00%> (+0.27%) ⬆️
controllers/datadogagent/clusterchecksrunner.go 78.91% <100.00%> (+0.23%) ⬆️
controllers/datadogagent/common_rbac.go 76.40% <100.00%> (+2.54%) ⬆️
... and 4 more

Continue to review full report at Codecov.

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

@clamoriniere clamoriniere added this to the v0.7 milestone Aug 4, 2021
@clamoriniere clamoriniere marked this pull request as ready for review August 4, 2021 15:04
@clamoriniere clamoriniere requested review from a team as code owners August 4, 2021 15:04
Copy link
Contributor

@kayayarai kayayarai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs 👍

* Update DatadogAgent CRD to allow custom configuration for the
  Orchestrator-Explorer feature.
* Create dedicated RBAC for the cluster-check-runners.
* Fix several controllers issues.
@clamoriniere clamoriniere force-pushed the clamoriniere/orchestrator-clusterchecks branch from eb3670e to 07d9e8a Compare August 5, 2021 08:58
})

By("Activating OrchestratorExplorer", func() {
By("Disabeling OrchestratorExplorer", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit disabling (also here)

@@ -169,16 +169,10 @@ var _ = Describe("DatadogAgent Controller", func() {
}, nil)
})

By("Activating Process", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removing this test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it after, and converted to "Disabling Process", because now since Orchestrator is enable by default, it means that process-agent is already running, so the By("Activating Process" ) was doing nothing.

@clamoriniere clamoriniere merged commit b0c187b into main Aug 6, 2021
@clamoriniere clamoriniere deleted the clamoriniere/orchestrator-clusterchecks branch August 6, 2021 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants