Skip to content

Commit

Permalink
Convert podLabelsAsTags and podAnnotationsAsTags (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
khewonc authored and Charly Fontaine committed Mar 1, 2023
1 parent c9c10cb commit 3170357
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apis/datadoghq/v1alpha1/datadogagent_conversion_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ func convertDatadogAgentSpec(src *DatadogAgentSpecAgentSpec, dst *v2alpha1.Datad
getV2TemplateOverride(&dst.Spec, v2alpha1.NodeAgentComponentName).ExtraChecksd = ConvertConfigDirSpec(src.Config.Checksd)
}

if src.Config.PodLabelsAsTags != nil {
getV2GlobalConfig(dst).PodLabelsAsTags = src.Config.PodLabelsAsTags
}

if src.Config.PodAnnotationsAsTags != nil {
getV2GlobalConfig(dst).PodAnnotationsAsTags = src.Config.PodAnnotationsAsTags
}

if src.Config.Tags != nil {
getV2GlobalConfig(dst).Tags = append(getV2GlobalConfig(dst).Tags, src.Config.Tags...)
}
Expand Down
4 changes: 4 additions & 0 deletions apis/datadoghq/v1alpha1/testdata/all.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ spec:
appSecret:
keyName: app-key
secretName: datadog-secret
podLabelsAsTags:
custom-tag1: custom-tag1
podAnnotationsAsTags:
custom-tag2: custom-tag2
criSocketPath: /var/run/crio/crio.sock
dockerSocketPath: /var/docker.sock
endpoint:
Expand Down

0 comments on commit 3170357

Please sign in to comment.