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: k8s version detection for agent service #472

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

clamoriniere
Copy link
Collaborator

What does this PR do?

Fix how we detect the Kubernetes version.
the information was already present in the reconciler.

the manageAgentService() function now use the information
from the Reconcile struct.

Motivation

Fix how we detect the Kubernetes version to automaticaly
create the local agent service if it is supported by the
kubernetes version.

Additional Notes

Describe your test plan

deploy the operator and create the DatadogAgent with this manifest

apiVersion: datadoghq.com/v1alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  agent:
    apm:
      enabled: true
  clusterName: foo
  credentials:
    apiSecret:
      keyName: api-key
      secretName: datadog-secret
    appSecret:
      keyName: app-key
      secretName: datadog-secret

the service datadog-agent should be created in the same namespace.

@clamoriniere clamoriniere requested a review from a team as a code owner April 26, 2022 14:05
@clamoriniere clamoriniere added bug Something isn't working component/controller labels Apr 26, 2022
@clamoriniere clamoriniere added this to the v0.8.0 milestone Apr 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2022

Codecov Report

Merging #472 (2a4f1c8) into main (b9ad1fc) will increase coverage by 2.43%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #472      +/-   ##
==========================================
+ Coverage   60.60%   63.04%   +2.43%     
==========================================
  Files           3        3              
  Lines         132      138       +6     
==========================================
+ Hits           80       87       +7     
+ Misses         40       38       -2     
- Partials       12       13       +1     
Flag Coverage Δ
unittests 63.04% <ø> (+2.43%) ⬆️

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

Impacted Files Coverage Δ
controllers/datadogagent_controller.go 64.38% <0.00%> (+4.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9ad1fc...2a4f1c8. Read the comment docs.

@clamoriniere clamoriniere merged commit 4bcdee6 into main Apr 26, 2022
@clamoriniere clamoriniere deleted the clamoriniere/local-service branch April 26, 2022 14:30
JacksonDavenport added a commit that referenced this pull request Apr 26, 2022
…v vars

Remove POD_X_AS_TAGS as no longer defaulting to {}

Test cases for various metadata as tags configs

Move the xyzAsTags to the common set of environment variables

Revert "Move the xyzAsTags to the common set of environment variables"

This reverts commit 11a8cfa.

Update tests to use NodeAgentConfig/EnvVar rather than generics

Add port names to agent service (#468)

Update default DCA image to 1.19.0 (#470)

Share common structs in common/v1 and adds missing fields to v2alpha1 (#438)

fix: k8s version detection for agent service (#472)

Rename Test_getEnvVarsForMetadataAsTags function
JacksonDavenport added a commit that referenced this pull request Apr 27, 2022
…v vars (#471)

Remove POD_X_AS_TAGS as no longer defaulting to {}

Test cases for various metadata as tags configs

Move the xyzAsTags to the common set of environment variables

Revert "Move the xyzAsTags to the common set of environment variables"

This reverts commit 11a8cfa.

Update tests to use NodeAgentConfig/EnvVar rather than generics

Add port names to agent service (#468)

Update default DCA image to 1.19.0 (#470)

Share common structs in common/v1 and adds missing fields to v2alpha1 (#438)

fix: k8s version detection for agent service (#472)

Rename Test_getEnvVarsForMetadataAsTags function

Co-authored-by: Celene Chang <celene@datadoghq.com>
JacksonDavenport added a commit that referenced this pull request Apr 28, 2022
…v vars (#471)

Remove POD_X_AS_TAGS as no longer defaulting to {}

Test cases for various metadata as tags configs

Move the xyzAsTags to the common set of environment variables

Revert "Move the xyzAsTags to the common set of environment variables"

This reverts commit 11a8cfa.

Update tests to use NodeAgentConfig/EnvVar rather than generics

Add port names to agent service (#468)

Update default DCA image to 1.19.0 (#470)

Share common structs in common/v1 and adds missing fields to v2alpha1 (#438)

fix: k8s version detection for agent service (#472)

Rename Test_getEnvVarsForMetadataAsTags function

Co-authored-by: Celene Chang <celene@datadoghq.com>
JacksonDavenport added a commit that referenced this pull request Apr 28, 2022
…v vars (#471) (#475)

Remove POD_X_AS_TAGS as no longer defaulting to {}

Test cases for various metadata as tags configs

Move the xyzAsTags to the common set of environment variables

Revert "Move the xyzAsTags to the common set of environment variables"

This reverts commit 11a8cfa.

Update tests to use NodeAgentConfig/EnvVar rather than generics

Add port names to agent service (#468)

Update default DCA image to 1.19.0 (#470)

Share common structs in common/v1 and adds missing fields to v2alpha1 (#438)

fix: k8s version detection for agent service (#472)

Rename Test_getEnvVarsForMetadataAsTags function

Co-authored-by: Celene Chang <celene@datadoghq.com>

Co-authored-by: Celene Chang <celene@datadoghq.com>
@khewonc khewonc mentioned this pull request May 17, 2022
celenechang added a commit that referenced this pull request May 18, 2022
…v vars (#471) (#475)

Remove POD_X_AS_TAGS as no longer defaulting to {}

Test cases for various metadata as tags configs

Move the xyzAsTags to the common set of environment variables

Revert "Move the xyzAsTags to the common set of environment variables"

This reverts commit 11a8cfa.

Update tests to use NodeAgentConfig/EnvVar rather than generics

Add port names to agent service (#468)

Update default DCA image to 1.19.0 (#470)

Share common structs in common/v1 and adds missing fields to v2alpha1 (#438)

fix: k8s version detection for agent service (#472)

Rename Test_getEnvVarsForMetadataAsTags function

Co-authored-by: Celene Chang <celene@datadoghq.com>

Co-authored-by: Celene Chang <celene@datadoghq.com>
celenechang added a commit that referenced this pull request May 18, 2022
…v vars (#471)

Remove POD_X_AS_TAGS as no longer defaulting to {}

Test cases for various metadata as tags configs

Move the xyzAsTags to the common set of environment variables

Revert "Move the xyzAsTags to the common set of environment variables"

This reverts commit 11a8cfa.

Update tests to use NodeAgentConfig/EnvVar rather than generics

Add port names to agent service (#468)

Update default DCA image to 1.19.0 (#470)

Share common structs in common/v1 and adds missing fields to v2alpha1 (#438)

fix: k8s version detection for agent service (#472)

Rename Test_getEnvVarsForMetadataAsTags function

Co-authored-by: Celene Chang <celene@datadoghq.com>
khewonc added a commit that referenced this pull request May 19, 2022
* release v0.8.0-rc.1

* [defaulting/images] Update agent to 7.35.0 (#465)

* [controllers/datadogagent/utils] Fix process collection nil check (#466)

* [examples] Fix datadog-agent-secret-backend (#467)

* Add port names to agent service (#468)

* Update default DCA image to 1.19.0 (#470)

* release v0.8.0-rc.2

* fix: k8s version detection for agent service (#472) (#473)

* Add NodeLabelsAsTags and NamespaceLabelsAsTags, remove default Pod env vars (#471) (#475)

Remove POD_X_AS_TAGS as no longer defaulting to {}

Test cases for various metadata as tags configs

Move the xyzAsTags to the common set of environment variables

Revert "Move the xyzAsTags to the common set of environment variables"

This reverts commit 11a8cfa.

Update tests to use NodeAgentConfig/EnvVar rather than generics

Add port names to agent service (#468)

Update default DCA image to 1.19.0 (#470)

Share common structs in common/v1 and adds missing fields to v2alpha1 (#438)

fix: k8s version detection for agent service (#472)

Rename Test_getEnvVarsForMetadataAsTags function

Co-authored-by: Celene Chang <celene@datadoghq.com>

Co-authored-by: Celene Chang <celene@datadoghq.com>

* release v0.8.0-rc.3

* Default Agent version to 7.35.2 (#480)

* release v0.8.0-rc.4

* release v0.8.0

Co-authored-by: David Ortiz <david.ortiz@datadoghq.com>
Co-authored-by: Cedric Lamoriniere <cedric.lamoriniere@datadoghq.com>
Co-authored-by: JacksonDavenport <jakdavenport@yahoo.com>
Co-authored-by: Celene Chang <celene@datadoghq.com>
Co-authored-by: Paul Cacheux <paul.cacheux@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/controller
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants