datadog-operator icon indicating copy to clipboard operation
datadog-operator copied to clipboard

[CECO-2029][DatadogAgentInternal] Setup dependencies with real owner while using copy for naming

Open tbavelier opened this issue 7 months ago • 1 comments

What does this PR do?

  • Provides a store option to use a different object than the owner to get labels/annotations, while still setting ownerref to the provided owner
  • Uses this option solely in the DDAI controller to use the profile DDAI copy (that's using the DDA name) for labels/annotations while still setting the ownerref to an existing/real object

Motivation

  • Avoid creating dependencies with non-existing object in ownerref causing it to be GCd: this would happen when using profiles and DDAI

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

tbavelier avatar Jun 27 '25 09:06 tbavelier

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 45.65%. Comparing base (d77c8c4) to head (f7dda11). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...er/datadogagentinternal/controller_reconcile_v2.go 0.00% 1 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2011      +/-   ##
==========================================
+ Coverage   45.20%   45.65%   +0.45%     
==========================================
  Files         271      271              
  Lines       28025    28245     +220     
==========================================
+ Hits        12669    12896     +227     
+ Misses      14697    14690       -7     
  Partials      659      659              
Flag Coverage Δ
unittests 45.65% <94.73%> (+0.45%) :arrow_up:

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

Files with missing lines Coverage Δ
internal/controller/datadogagent/store/store.go 70.94% <100.00%> (+5.70%) :arrow_up:
...ogagentinternal/controller_reconcile_v2_helpers.go 28.94% <100.00%> (+0.94%) :arrow_up:
...er/datadogagentinternal/controller_reconcile_v2.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes


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 d77c8c4...f7dda11. Read the comment docs.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jun 27 '25 09:06 codecov-commenter

Closing in favour of https://github.com/DataDog/datadog-operator/pull/2014

tbavelier avatar Jun 30 '25 09:06 tbavelier