diff --git a/api/v1/inline_types.go b/api/v1/inline_types.go index 6d45b9b9..aefb9f21 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 compatibility + 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 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