From 6026e8cc18154e1a68100f1852de62c4f7506a3a Mon Sep 17 00:00:00 2001 From: Celene Date: Tue, 23 Jul 2024 10:45:55 -0400 Subject: [PATCH] rename Language Detection struct --- .../v2alpha1/datadogagent_default.go | 2 +- .../v2alpha1/datadogagent_default_test.go | 24 +++++++++---------- apis/datadoghq/v2alpha1/datadogagent_types.go | 10 ++++---- apis/datadoghq/v2alpha1/test/builder.go | 2 +- .../v2alpha1/zz_generated.deepcopy.go | 10 ++++---- .../bases/v1/datadoghq.com_datadogagents.yaml | 8 +++---- docs/configuration.v2alpha1.md | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/apis/datadoghq/v2alpha1/datadogagent_default.go b/apis/datadoghq/v2alpha1/datadogagent_default.go index 56a206cc6..78de099eb 100644 --- a/apis/datadoghq/v2alpha1/datadogagent_default.go +++ b/apis/datadoghq/v2alpha1/datadogagent_default.go @@ -271,7 +271,7 @@ func defaultFeaturesConfig(ddaSpec *DatadogAgentSpec) { } if ddaSpec.Features.APM.SingleStepInstrumentation.LanguageDetection == nil { - ddaSpec.Features.APM.SingleStepInstrumentation.LanguageDetection = &LanguageDetection{} + ddaSpec.Features.APM.SingleStepInstrumentation.LanguageDetection = &LanguageDetectionConfig{} } apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.APM.SingleStepInstrumentation.Enabled, defaultAPMSingleStepInstrEnabled) diff --git a/apis/datadoghq/v2alpha1/datadogagent_default_test.go b/apis/datadoghq/v2alpha1/datadogagent_default_test.go index 77b66fc5e..79a9a3da7 100644 --- a/apis/datadoghq/v2alpha1/datadogagent_default_test.go +++ b/apis/datadoghq/v2alpha1/datadogagent_default_test.go @@ -193,7 +193,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -502,7 +502,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -632,7 +632,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -757,7 +757,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -882,7 +882,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -1016,7 +1016,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -1141,7 +1141,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -1269,7 +1269,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -1386,7 +1386,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -1525,7 +1525,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -1672,7 +1672,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ @@ -1800,7 +1800,7 @@ func Test_defaultFeatures(t *testing.T) { }, SingleStepInstrumentation: &SingleStepInstrumentation{ Enabled: apiutils.NewBoolPointer(defaultAPMSingleStepInstrEnabled), - LanguageDetection: &LanguageDetection{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, + LanguageDetection: &LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(defaultLanguageDetectionEnabled)}, }, }, ASM: &ASMFeatureConfig{ diff --git a/apis/datadoghq/v2alpha1/datadogagent_types.go b/apis/datadoghq/v2alpha1/datadogagent_types.go index e3c250efb..9126ce325 100644 --- a/apis/datadoghq/v2alpha1/datadogagent_types.go +++ b/apis/datadoghq/v2alpha1/datadogagent_types.go @@ -157,15 +157,15 @@ type SingleStepInstrumentation struct { // +optional LibVersions map[string]string `json:"libVersions,omitempty"` - // Language detection currently only detects languages and adds them as annotations on deployments, but doesn't use these languages for injecting libraries to applicative pods. + // LanguageDetection detects languages and adds them as annotations on Deployments, but does not use these languages for injecting libraries to workload pods. // (Requires Agent 7.52.0+ and Cluster Agent 7.52.0+) // +optional - LanguageDetection *LanguageDetection `json:"languageDetection,omitempty"` + LanguageDetection *LanguageDetectionConfig `json:"languageDetection,omitempty"` } -// LanguageDetection contains the config for the language detection feature. -type LanguageDetection struct { - // Enabled enables language detection to automatically detect languages of user workloads (beta). +// LanguageDetectionConfig contains the config for Language Detection. +type LanguageDetectionConfig struct { + // Enabled enables Language Detection to automatically detect languages of user workloads (beta). // Requires SingleStepInstrumentation.Enabled to be true. // Default: true // +optional diff --git a/apis/datadoghq/v2alpha1/test/builder.go b/apis/datadoghq/v2alpha1/test/builder.go index 6aca65be6..97c5f844d 100644 --- a/apis/datadoghq/v2alpha1/test/builder.go +++ b/apis/datadoghq/v2alpha1/test/builder.go @@ -566,7 +566,7 @@ func (builder *DatadogAgentBuilder) WithAPMSingleStepInstrumentationEnabled(enab EnabledNamespaces: enabledNamespaces, DisabledNamespaces: disabledNamespaces, LibVersions: libVersion, - LanguageDetection: &v2alpha1.LanguageDetection{Enabled: apiutils.NewBoolPointer(languageDetectionEnabled)}, + LanguageDetection: &v2alpha1.LanguageDetectionConfig{Enabled: apiutils.NewBoolPointer(languageDetectionEnabled)}, } return builder } diff --git a/apis/datadoghq/v2alpha1/zz_generated.deepcopy.go b/apis/datadoghq/v2alpha1/zz_generated.deepcopy.go index f7ca75c98..2098c4d96 100644 --- a/apis/datadoghq/v2alpha1/zz_generated.deepcopy.go +++ b/apis/datadoghq/v2alpha1/zz_generated.deepcopy.go @@ -1556,7 +1556,7 @@ func (in *KubeStateMetricsCoreFeatureConfig) DeepCopy() *KubeStateMetricsCoreFea } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LanguageDetection) DeepCopyInto(out *LanguageDetection) { +func (in *LanguageDetectionConfig) DeepCopyInto(out *LanguageDetectionConfig) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled @@ -1565,12 +1565,12 @@ func (in *LanguageDetection) DeepCopyInto(out *LanguageDetection) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LanguageDetection. -func (in *LanguageDetection) DeepCopy() *LanguageDetection { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LanguageDetectionConfig. +func (in *LanguageDetectionConfig) DeepCopy() *LanguageDetectionConfig { if in == nil { return nil } - out := new(LanguageDetection) + out := new(LanguageDetectionConfig) in.DeepCopyInto(out) return out } @@ -2310,7 +2310,7 @@ func (in *SingleStepInstrumentation) DeepCopyInto(out *SingleStepInstrumentation } if in.LanguageDetection != nil { in, out := &in.LanguageDetection, &out.LanguageDetection - *out = new(LanguageDetection) + *out = new(LanguageDetectionConfig) (*in).DeepCopyInto(*out) } } diff --git a/config/crd/bases/v1/datadoghq.com_datadogagents.yaml b/config/crd/bases/v1/datadoghq.com_datadogagents.yaml index 90b21ebd3..596447a82 100644 --- a/config/crd/bases/v1/datadoghq.com_datadogagents.yaml +++ b/config/crd/bases/v1/datadoghq.com_datadogagents.yaml @@ -491,12 +491,12 @@ spec: x-kubernetes-list-type: set languageDetection: description: |- - Language detection currently only detects languages and adds them as annotations on deployments, but doesn't use these languages for injecting libraries to applicative pods. + LanguageDetection detects languages and adds them as annotations on Deployments, but does not use these languages for injecting libraries to workload pods. (Requires Agent 7.52.0+ and Cluster Agent 7.52.0+) properties: enabled: description: |- - Enabled enables language detection to automatically detect languages of user workloads (beta). + Enabled enables Language Detection to automatically detect languages of user workloads (beta). Requires SingleStepInstrumentation.Enabled to be true. Default: true type: boolean @@ -6344,12 +6344,12 @@ spec: x-kubernetes-list-type: set languageDetection: description: |- - Language detection currently only detects languages and adds them as annotations on deployments, but doesn't use these languages for injecting libraries to applicative pods. + LanguageDetection detects languages and adds them as annotations on Deployments, but does not use these languages for injecting libraries to workload pods. (Requires Agent 7.52.0+ and Cluster Agent 7.52.0+) properties: enabled: description: |- - Enabled enables language detection to automatically detect languages of user workloads (beta). + Enabled enables Language Detection to automatically detect languages of user workloads (beta). Requires SingleStepInstrumentation.Enabled to be true. Default: true type: boolean diff --git a/docs/configuration.v2alpha1.md b/docs/configuration.v2alpha1.md index 2ef8153e3..81f97a5be 100644 --- a/docs/configuration.v2alpha1.md +++ b/docs/configuration.v2alpha1.md @@ -59,7 +59,7 @@ spec: | features.apm.instrumentation.disabledNamespaces | DisabledNamespaces disables injecting the Datadog APM libraries into pods in specific namespaces. | | features.apm.instrumentation.enabled | Enabled enables injecting the Datadog APM libraries into all pods in the cluster. Default: false | | features.apm.instrumentation.enabledNamespaces | EnabledNamespaces enables injecting the Datadog APM libraries into pods in specific namespaces. | -| features.apm.instrumentation.languageDetection.enabled | Enabled enables language detection to automatically detect languages of user workloads (beta). Requires SingleStepInstrumentation.Enabled to be true. Default: true | +| features.apm.instrumentation.languageDetection.enabled | Enabled enables Language Detection to automatically detect languages of user workloads (beta). Requires SingleStepInstrumentation.Enabled to be true. Default: true | | features.apm.instrumentation.libVersions | LibVersions configures injection of specific tracing library versions with Single Step Instrumentation. : ex: "java": "v1.18.0" | | features.apm.unixDomainSocketConfig.enabled | Enabled enables Unix Domain Socket. Default: true | | features.apm.unixDomainSocketConfig.path | Path defines the socket path used when enabled. |