DataDog / datadog-operator

Kubernetes Operator for Datadog Resources
Apache License 2.0
303 stars 105 forks source link

Add global environment variable config #1406

Closed swang392 closed 2 months ago

swang392 commented 2 months ago

What does this PR do?

Added configuration for global environment variables; environment variables defined in global.env of the Datadog Agent CRD will be set across all agents in Operator.

Motivation

issue 961

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

Checklist

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 35.00000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 47.63%. Comparing base (6d4bbd9) to head (4a0a15a). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/testutils/agent.go 0.00% 13 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406/graphs/tree.svg?width=650&height=150&src=pr&token=b1U0O5wQwj&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ```diff @@ Coverage Diff @@ ## main #1406 +/- ## ========================================== + Coverage 47.40% 47.63% +0.22% ========================================== Files 223 224 +1 Lines 19244 19522 +278 ========================================== + Hits 9123 9299 +176 - Misses 9635 9723 +88 - Partials 486 500 +14 ``` | [Flag](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `47.63% <35.00%> (+0.22%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [api/datadoghq/v2alpha1/datadogagent\_types.go](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?src=pr&el=tree&filepath=api%2Fdatadoghq%2Fv2alpha1%2Fdatadogagent_types.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-YXBpL2RhdGFkb2docS92MmFscGhhMS9kYXRhZG9nYWdlbnRfdHlwZXMuZ28=) | `100.00% <ø> (ø)` | | | [api/datadoghq/v2alpha1/test/builder.go](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?src=pr&el=tree&filepath=api%2Fdatadoghq%2Fv2alpha1%2Ftest%2Fbuilder.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-YXBpL2RhdGFkb2docS92MmFscGhhMS90ZXN0L2J1aWxkZXIuZ28=) | `91.49% <100.00%> (+0.04%)` | :arrow_up: | | [...nternal/controller/datadogagent/override/global.go](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?src=pr&el=tree&filepath=internal%2Fcontroller%2Fdatadogagent%2Foverride%2Fglobal.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-aW50ZXJuYWwvY29udHJvbGxlci9kYXRhZG9nYWdlbnQvb3ZlcnJpZGUvZ2xvYmFsLmdv) | `42.14% <100.00%> (+0.97%)` | :arrow_up: | | [internal/controller/testutils/agent.go](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?src=pr&el=tree&filepath=internal%2Fcontroller%2Ftestutils%2Fagent.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-aW50ZXJuYWwvY29udHJvbGxlci90ZXN0dXRpbHMvYWdlbnQuZ28=) | `0.00% <0.00%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Last update [6d4bbd9...4a0a15a](https://app.codecov.io/gh/DataDog/datadog-operator/pull/1406?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog).