From 437b7a61535f8058315b38b5809952250f54cd02 Mon Sep 17 00:00:00 2001 From: ZachRobinson Date: Tue, 24 Jan 2023 11:20:48 -0600 Subject: [PATCH 1/3] OpenTelemetry settings update in code definition Signed-off-by: ZachRobinson --- api/v1/inline_types.go | 11 +++++++++++ api/v1/instanaagent_types.go | 2 +- api/v1beta1/instanaagent_conversion.go | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/api/v1/inline_types.go b/api/v1/inline_types.go index 6d45b9b9..dc6190fe 100644 --- a/api/v1/inline_types.go +++ b/api/v1/inline_types.go @@ -270,3 +270,14 @@ type KubernetesDeploymentSpec struct { // +kubebuilder:validation:Optional Pod coreV1.ResourceRequirements `json:"pod,omitempty"` } + +type OpenTelemetry struct { + // Deprecated setting for backwards compatability + Enabled `json:",inline"` + + // +kubebuilder:validation:Optional + GRPC Enabled `json:"grpc,omitempty"` + + // +kubebuilder:validation:Optional + HTTP Enabled `json:"http,omitempty"` +} diff --git a/api/v1/instanaagent_types.go b/api/v1/instanaagent_types.go index 58390d6f..7a298cef 100644 --- a/api/v1/instanaagent_types.go +++ b/api/v1/instanaagent_types.go @@ -42,7 +42,7 @@ type InstanaAgentSpec struct { // Enables the OpenTelemetry gRPC endpoint on the Agent. If true, it will also apply `service.create: true`. // +kubebuilder:validation:Optional - OpenTelemetry Enabled `json:"opentelemetry,omitempty"` + OpenTelemetry OpenTelemetry `json:"opentelemetry,omitempty"` // Enables the Prometheus endpoint on the Agent. If true, it will also apply `service.create: true`. // +kubebuilder:validation:Optional diff --git a/api/v1beta1/instanaagent_conversion.go b/api/v1beta1/instanaagent_conversion.go index a8d863d0..59bd50bd 100644 --- a/api/v1beta1/instanaagent_conversion.go +++ b/api/v1beta1/instanaagent_conversion.go @@ -92,7 +92,7 @@ func (src *InstanaAgent) convertInternalSpecTo(dst *v1.InstanaAgent) { } dst.Spec.Rbac.Create = srcSpec.AgentRbacCreate - dst.Spec.OpenTelemetry.Enabled = srcSpec.OpenTelemetryEnabled + dst.Spec.OpenTelemetry.Enabled.Enabled = srcSpec.OpenTelemetryEnabled dst.Spec.Agent.TlsSpec.SecretName = srcSpec.AgentTlsSecretName dst.Spec.Agent.TlsSpec.Certificate = srcSpec.AgentTlsCertificate @@ -175,7 +175,7 @@ func (dst *InstanaAgent) ConvertFrom(srcRaw conversion.Hub) error { } dst.Spec.AgentRbacCreate = src.Spec.Rbac.Create - dst.Spec.OpenTelemetryEnabled = src.Spec.OpenTelemetry.Enabled + dst.Spec.OpenTelemetryEnabled = src.Spec.OpenTelemetry.Enabled.Enabled dst.Spec.AgentTlsSecretName = src.Spec.Agent.TlsSpec.SecretName dst.Spec.AgentTlsCertificate = src.Spec.Agent.TlsSpec.Certificate From ac9b13dcc2443aef5a242d30721252b75c51a4b0 Mon Sep 17 00:00:00 2001 From: ZachRobinson Date: Tue, 24 Jan 2023 11:51:54 -0600 Subject: [PATCH 2/3] update generated CRDs Signed-off-by: ZachRobinson --- bundle/manifests/instana.io_agents.yaml | 10 ++++++++++ config/crd/bases/instana.io_agents.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/bundle/manifests/instana.io_agents.yaml b/bundle/manifests/instana.io_agents.yaml index 22ff1e93..d7652557 100644 --- a/bundle/manifests/instana.io_agents.yaml +++ b/bundle/manifests/instana.io_agents.yaml @@ -1417,6 +1417,16 @@ spec: properties: enabled: type: boolean + grpc: + properties: + enabled: + type: boolean + type: object + http: + properties: + enabled: + type: boolean + type: object type: object opentelemetry.enabled: type: boolean diff --git a/config/crd/bases/instana.io_agents.yaml b/config/crd/bases/instana.io_agents.yaml index 45302498..6bf7435f 100644 --- a/config/crd/bases/instana.io_agents.yaml +++ b/config/crd/bases/instana.io_agents.yaml @@ -1405,6 +1405,16 @@ spec: properties: enabled: type: boolean + grpc: + properties: + enabled: + type: boolean + type: object + http: + properties: + enabled: + type: boolean + type: object type: object opentelemetry.enabled: type: boolean From 6a007d3f86119aa9aed8f3fb7cdf57b18d2ce2a6 Mon Sep 17 00:00:00 2001 From: ZachRobinson Date: Fri, 27 Jan 2023 15:50:56 -0600 Subject: [PATCH 3/3] fix typo Signed-off-by: ZachRobinson --- api/v1/inline_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/inline_types.go b/api/v1/inline_types.go index dc6190fe..aefb9f21 100644 --- a/api/v1/inline_types.go +++ b/api/v1/inline_types.go @@ -272,7 +272,7 @@ type KubernetesDeploymentSpec struct { } type OpenTelemetry struct { - // Deprecated setting for backwards compatability + // Deprecated setting for backwards compatibility Enabled `json:",inline"` // +kubebuilder:validation:Optional