-
Notifications
You must be signed in to change notification settings - Fork 104
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 for CRD-specific watch namespaces configuration #1235
Conversation
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.
This pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, refactoring, documentation, tooling, dependencies
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.
This pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, refactoring, documentation, tooling, dependencies
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1235 +/- ##
==========================================
+ Coverage 54.87% 55.03% +0.16%
==========================================
Files 243 243
Lines 28120 28165 +45
==========================================
+ Hits 15430 15502 +72
+ Misses 11815 11785 -30
- Partials 875 878 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
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.
I know you're still drafting this, but I left a couple very minor suggestions in the meantime. Please let Docs know if add more content and need another look!
2b402f3
to
18dc6cf
Compare
Co-authored-by: Celene <celene@datadoghq.com>
Co-authored-by: Celene <celene@datadoghq.com>
Co-authored-by: Celene <celene@datadoghq.com>
Co-authored-by: Celene <celene@datadoghq.com>
Co-authored-by: Celene <celene@datadoghq.com>
Co-authored-by: Celene <celene@datadoghq.com>
Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>
* CRD-specific watch namespaces * Support for CRD-specific watch namespaces configuration * Update main.go Co-authored-by: Celene <celene@datadoghq.com> * Update pkg/config/config.go Co-authored-by: Celene <celene@datadoghq.com> * Update pkg/config/config.go Co-authored-by: Celene <celene@datadoghq.com> * Update pkg/config/config.go Co-authored-by: Celene <celene@datadoghq.com> * Update pkg/config/config.go Co-authored-by: Celene <celene@datadoghq.com> * Watch nodes when introspection is enabled; Refactor * Set DefaultNamespace to agent namespaces * Update pkg/config/config.go Co-authored-by: Celene <celene@datadoghq.com> * Update pkg/config/config.go Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com> --------- Co-authored-by: Celene <celene@datadoghq.com> Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>
What does this PR do?
CECO-1021
For Reviewer: first commit is actual change; second commit is mostly refactor.
controller-runtime 0.16 allows cache configuration on resource level. This change adds CRD-specific watch namespace env vars and sets them on corresponding CRDs or related 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?
Describe your test plan
Test using DatadogMonitors CRD, use following manifests to create monitors in two different namespaces.
Namespace
monitor1
Namespace
monitor2
Operator doesn't watch
namespace1
ornamespace2
.datadogMonitorEnabled
set to true (with API, APP key set), running indatadog
namespace.Operator shouldn't reconcile the monitors from other namespaces (nothing logged or created).
Add
monitor1
namespaceObserve monitor from
monitor1
namespace getting reconciled - check logs and datadog app to confirm it's created.monitor2
to above env varObserver monitor in
monitor2
reconciled as well.Write there any instructions and details you may have to test your PR.
Checklist
bug
,enhancement
,refactoring
,documentation
,tooling
, and/ordependencies
qa/skip-qa
label