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

add generation changed predicate to datadogagent controller

Open celenechang opened this issue 1 year ago • 1 comments
trafficstars

What does this PR do?

Add GenerationChanged predicate to DatadogAgent controller to prevent Status updates from triggering reconciles on the resource.

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

  • Deploy the latest Datadog Operator and apply a DatadogAgent manifest

  • View the logs to see reconcile frequency (Reconciling DatadogAgent). It is expected to be at least twice per second, every 15s.

  • Deploy the test image

  • Check the reconcile frequency. The number of reconciles should be reduced (in my test environment, it went down to once every 15s).

Checklist

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

celenechang avatar Jul 03 '24 14:07 celenechang

Codecov Report

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

Project coverage is 54.85%. Comparing base (87546e6) to head (2ecc870).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1266      +/-   ##
==========================================
- Coverage   54.87%   54.85%   -0.02%     
==========================================
  Files         241      241              
  Lines       27893    27893              
==========================================
- Hits        15305    15302       -3     
- Misses      11717    11719       +2     
- Partials      871      872       +1     
Flag Coverage Δ
unittests 54.85% <0.00%> (-0.02%) :arrow_down:

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

Files Coverage Δ
controllers/datadogagent_controller.go 68.14% <0.00%> (-2.66%) :arrow_down:

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 87546e6...2ecc870. Read the comment docs.

codecov-commenter avatar Jul 03 '24 14:07 codecov-commenter