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

[Orch] Add CRD RC handler #1340

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

[Orch] Add CRD RC handler #1340

wants to merge 28 commits into from

Conversation

JLineaweaver
Copy link
Contributor

What does this PR do?

Adds remote config support for custom resources in the operator. This new code will merge the user defined configuration with the configuration stored in remote config. Operator users with remote config enabled should no longer require a custom operator configuration to send custom resources.

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?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

Write there any instructions and details you may have to test your PR.

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

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, refactoring, documentation, tooling, dependencies

@JLineaweaver JLineaweaver added the enhancement New feature or request label Aug 2, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 10.48387% with 111 lines in your changes missing coverage. Please review.

Project coverage is 48.78%. Comparing base (0361cbf) to head (0d7650d).

Files with missing lines Patch % Lines
pkg/remoteconfig/orchestrator_k8s_crd.go 0.00% 88 Missing ⚠️
pkg/remoteconfig/updater.go 0.00% 14 Missing ⚠️
...tadogagent/feature/orchestratorexplorer/feature.go 59.09% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1340      +/-   ##
==========================================
- Coverage   49.01%   48.78%   -0.24%     
==========================================
  Files         223      224       +1     
  Lines       19508    19623     +115     
==========================================
+ Hits         9562     9573      +11     
- Misses       9456     9560     +104     
  Partials      490      490              
Flag Coverage Δ
unittests 48.78% <10.48%> (-0.24%) ⬇️

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

Files with missing lines Coverage Δ
...tadogagent/feature/orchestratorexplorer/feature.go 76.00% <59.09%> (-3.24%) ⬇️
pkg/remoteconfig/updater.go 0.00% <0.00%> (ø)
pkg/remoteconfig/orchestrator_k8s_crd.go 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

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

@JLineaweaver JLineaweaver added this to the v1.9.0 milestone Aug 9, 2024
CoreAgent *CoreAgentFeaturesConfig `json:"config,omitempty"`
SystemProbe *SystemProbeFeaturesConfig `json:"system_probe,omitempty"`
SecurityAgent *SecurityAgentFeaturesConfig `json:"security_agent,omitempty"`
CRDs *CustomResourceDefinitionURLs `json:"crds,omitempty"`

Choose a reason for hiding this comment

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

Take this with a grain of salt since I'm not too familiar with the operator, but this looks to me like structurally, configs are broken out by agent binary. Should the CRD configs be wrapped inside a ClusterAgentFeatureConfig type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's a great call. I think this is a good idea for future work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@levan-m levan-m modified the milestones: v1.9.0, v1.10.0 Aug 26, 2024
@@ -137,7 +146,7 @@ func (r *RemoteConfigUpdater) Start(apiKey string, site string, clusterName stri
"",
r.serviceConf.baseRawURL,
r.serviceConf.hostname,
[]string{fmt.Sprintf("cluster_name:%s", r.serviceConf.clusterName)},
r.getTags,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a required breaking change

@JLineaweaver JLineaweaver force-pushed the jlineaweaver/cap-1652 branch 2 times, most recently from 72892db to 994024f Compare September 20, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants