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

Added DNSpolicy and DNSConfig overrides #1233

Merged
merged 2 commits into from
Jun 24, 2024
Merged

Added DNSpolicy and DNSConfig overrides #1233

merged 2 commits into from
Jun 24, 2024

Conversation

Eokye
Copy link
Contributor

@Eokye Eokye commented Jun 12, 2024

What does this PR do?

CECO-1252(https://datadoghq.atlassian.net/browse/CECO-1252
DNS config and DNS policy overrides were migrated to v2 from v1. This change fixes that.

A brief description of the change being made with this pull request.
DNS config + policy added to overrides and unit tested.

Motivation

What inspired you to submit this pull request?
#1144
https://datadoghq.atlassian.net/browse/CONS-6318

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

Used this manifest for the datadog-agent on a kind local cluster:

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  override:
    nodeAgent:
      image:
        name: gcr.io/datadoghq/agent:7.55.0-rc.3
      dnsPolicy: ClusterFirstWithHostNet
      dnsConfig: 
        nameservers:
        - 10.9.8.7
        - 10.9.7.4
    clusterAgent:
      image:
        name: gcr.io/datadoghq/cluster-agent:7.55.0-rc.3
    clusterChecksRunner:
      image:
        name: gcr.io/datadoghq/agent:7.55.0-rc.3
  global:
    clusterName: kind-control
    kubelet:
      tlsVerify: false
    site: datadoghq.com
    credentials:
      apiSecret:
        secretName: datadog-secret
        keyName: api-key

The resulting change in the agent pod CRD:

  dnsConfig:
    nameservers:
    - 10.9.8.7
    - 10.9.7.4
  dnsPolicy: ClusterFirstWithHostNet

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

@Eokye Eokye requested review from a team as code owners June 12, 2024 22:02
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

@levan-m levan-m added this to the v1.8.0 milestone Jun 13, 2024
@levan-m levan-m added enhancement New feature or request and removed feature request labels Jun 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 51.51515% with 16 lines in your changes missing coverage. Please review.

Project coverage is 59.30%. Comparing base (c46b61d) to head (8eac693).
Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1233      +/-   ##
==========================================
- Coverage   59.33%   59.30%   -0.03%     
==========================================
  Files         177      177              
  Lines       22371    22390      +19     
==========================================
+ Hits        13273    13279       +6     
- Misses       8286     8299      +13     
  Partials      812      812              
Flag Coverage Δ
unittests 59.30% <51.51%> (-0.03%) ⬇️

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

Files Coverage Δ
apis/datadoghq/v1alpha1/datadogagent_types.go 100.00% <ø> (ø)
apis/datadoghq/v2alpha1/datadogagent_types.go 100.00% <ø> (ø)
...ntrollers/datadogagent/override/podtemplatespec.go 72.72% <100.00%> (+0.56%) ⬆️
controllers/datadogagent_controller.go 70.53% <100.00%> (-0.38%) ⬇️
...ontrollers/datadogagent/controller_reconcile_v2.go 53.91% <75.00%> (+0.37%) ⬆️
pkg/plugin/common/client.go 0.00% <0.00%> (ø)
pkg/config/config.go 0.00% <0.00%> (ø)

... and 1 file 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 c46b61d...8eac693. Read the comment docs.

@Eokye Eokye merged commit 7aa8e46 into main Jun 24, 2024
19 checks passed
@Eokye Eokye deleted the DNSoverrides branch June 24, 2024 20:46
mftoure pushed a commit that referenced this pull request Oct 3, 2024
* Squashed and signed commits

* merge main into DNSoverrides
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