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

Fix behavior when overriding names of DCA and CCR components #1448

Merged
merged 6 commits into from
Oct 9, 2024

Conversation

mrdoggopat
Copy link
Contributor

@mrdoggopat mrdoggopat commented Oct 3, 2024

What does this PR do?

Fix behavior when overriding names of DCA and CCR components. Previously, the old DCA and CCR components do not get cleaned up when changing the override names. Only the node agent component gets cleaned up.

Motivation

CECO-1136

Describe your test plan

Use the following DatadogAgent configurations to change the default name of the components:

spec:
  override:
    nodeAgent:
      name: foo-agent
    clusterAgent:
      name: foo-dca-agent
    clusterChecksRunner:
      name: foo-ccr-agent

After the pods are successfully running, change the config to this:

spec:
  override:
    nodeAgent:
      name: foo-agent-test
    clusterAgent:
      name: foo-dca-agent-test
    clusterChecksRunner:
      name: foo-ccr-agent-test

Run kubectl get pods and you should see that the old pod names for the DCA and CCR are cleaned up and terminated and the new ones should be running with the following names for the node agent, DCA, and CCR respectively:

  • foo-agent-test
  • foo-dca-agent-test
  • foo-ccr-agent-test

Can also remove the above configurations and check if the clean up is happening as expected and the new ones should default to the original names. For example, if you named your DatadogAgent as datadog, it should just be:

  • datadog-agent
  • datadog-cluster-agent
  • datadog-cluster-checks-runner

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

@mrdoggopat mrdoggopat added bug Something isn't working fixed labels Oct 3, 2024
@mrdoggopat mrdoggopat added this to the v1.10.0 milestone Oct 3, 2024
@mrdoggopat mrdoggopat requested a review from a team as a code owner October 3, 2024 15:57
@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 58.62069% with 24 lines in your changes missing coverage. Please review.

Project coverage is 49.15%. Comparing base (0361cbf) to head (9edfa87).

Files with missing lines Patch % Lines
...controller/datadogagent/controller_reconcile_v2.go 0.00% 9 Missing and 3 partials ⚠️
...ontroller/datadogagent/controller_reconcile_ccr.go 73.91% 4 Missing and 2 partials ⚠️
...ontroller/datadogagent/controller_reconcile_dca.go 73.91% 4 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1448      +/-   ##
==========================================
+ Coverage   49.01%   49.15%   +0.14%     
==========================================
  Files         223      223              
  Lines       19508    19562      +54     
==========================================
+ Hits         9562     9616      +54     
+ Misses       9456     9444      -12     
- Partials      490      502      +12     
Flag Coverage Δ
unittests 49.15% <58.62%> (+0.14%) ⬆️

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

Files with missing lines Coverage Δ
...ontroller/datadogagent/controller_reconcile_ccr.go 57.42% <73.91%> (+9.98%) ⬆️
...ontroller/datadogagent/controller_reconcile_dca.go 50.00% <73.91%> (+23.62%) ⬆️
...controller/datadogagent/controller_reconcile_v2.go 52.30% <0.00%> (-1.82%) ⬇️

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...9edfa87. Read the comment docs.

@mrdoggopat mrdoggopat force-pushed the mrmcpat-cleanup-extraneous-dca-ccr branch from a5438e0 to 7c532a9 Compare October 9, 2024 18:42
@mrdoggopat mrdoggopat merged commit 582f311 into main Oct 9, 2024
19 checks passed
@mrdoggopat mrdoggopat deleted the mrmcpat-cleanup-extraneous-dca-ccr branch October 9, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants