diff --git a/api/telemetry/v1alpha1/oteloutput_types.go b/api/telemetry/v1alpha1/oteloutput_types.go index 4a35b98e..c01b6cee 100644 --- a/api/telemetry/v1alpha1/oteloutput_types.go +++ b/api/telemetry/v1alpha1/oteloutput_types.go @@ -32,10 +32,10 @@ type OtelOutputSpec struct { // OTLP grpc exporter config ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go type OTLPgrpc struct { - QueueConfig QueueSettings `json:"sending_queue,omitempty" yaml:"sending_queue,omitempty"` - RetryConfig BackOffConfig `json:"retry_on_failure,omitempty" yaml:"retry_on_failure,omitempty"` - TimeoutSettings `json:",inline" yaml:",inline"` - GRPCClientSettings `json:",inline" yaml:",inline"` + QueueConfig QueueSettings `json:"sending_queue,omitempty" yaml:"sending_queue,omitempty"` + RetryConfig BackOffConfig `json:"retry_on_failure,omitempty" yaml:"retry_on_failure,omitempty"` + TimeoutSettings `json:",inline" yaml:",inline"` + ClientConfig `json:",inline" yaml:",inline"` } // OtelOutputStatus defines the observed state of OtelOutput diff --git a/api/telemetry/v1alpha1/otlp_config.go b/api/telemetry/v1alpha1/otlp_config.go index a794992a..e4661b81 100644 --- a/api/telemetry/v1alpha1/otlp_config.go +++ b/api/telemetry/v1alpha1/otlp_config.go @@ -68,8 +68,8 @@ type KeepaliveClientConfig struct { PermitWithoutStream bool `json:"permit_without_stream,omitempty" yaml:"permit_without_stream,omitempty"` } -// GRPCClientSettings defines common settings for a gRPC client configuration. -type GRPCClientSettings struct { +// ClientConfig defines common settings for a gRPC client configuration. +type ClientConfig struct { // The target to which the exporter is going to send traces or metrics, // using the gRPC protocol. The valid syntax is described at // https://github.com/grpc/grpc/blob/master/doc/naming.md. diff --git a/api/telemetry/v1alpha1/zz_generated.deepcopy.go b/api/telemetry/v1alpha1/zz_generated.deepcopy.go index 99597a6a..d7a784dc 100644 --- a/api/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/api/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -38,6 +38,34 @@ func (in *BackOffConfig) DeepCopy() *BackOffConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientConfig) DeepCopyInto(out *ClientConfig) { + *out = *in + out.TLSSetting = in.TLSSetting + if in.Keepalive != nil { + in, out := &in.Keepalive, &out.Keepalive + *out = new(KeepaliveClientConfig) + **out = **in + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConfig. +func (in *ClientConfig) DeepCopy() *ClientConfig { + if in == nil { + return nil + } + out := new(ClientConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Collector) DeepCopyInto(out *Collector) { *out = *in @@ -133,34 +161,6 @@ func (in *CollectorStatus) DeepCopy() *CollectorStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCClientSettings) DeepCopyInto(out *GRPCClientSettings) { - *out = *in - out.TLSSetting = in.TLSSetting - if in.Keepalive != nil { - in, out := &in.Keepalive, &out.Keepalive - *out = new(KeepaliveClientConfig) - **out = **in - } - if in.Headers != nil { - in, out := &in.Headers, &out.Headers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCClientSettings. -func (in *GRPCClientSettings) DeepCopy() *GRPCClientSettings { - if in == nil { - return nil - } - out := new(GRPCClientSettings) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KeepaliveClientConfig) DeepCopyInto(out *KeepaliveClientConfig) { *out = *in @@ -197,7 +197,7 @@ func (in *OTLPgrpc) DeepCopyInto(out *OTLPgrpc) { out.QueueConfig = in.QueueConfig out.RetryConfig = in.RetryConfig out.TimeoutSettings = in.TimeoutSettings - in.GRPCClientSettings.DeepCopyInto(&out.GRPCClientSettings) + in.ClientConfig.DeepCopyInto(&out.ClientConfig) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPgrpc. diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 12146439..ad13e96b 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: ghcr.io/kube-logging/telemetry-controller + newName: controller newTag: latest diff --git a/internal/controller/telemetry/collector_controller.go b/internal/controller/telemetry/collector_controller.go index dc568402..4c0db1c5 100644 --- a/internal/controller/telemetry/collector_controller.go +++ b/internal/controller/telemetry/collector_controller.go @@ -211,7 +211,7 @@ func (r *CollectorReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( Spec: otelv1alpha1.OpenTelemetryCollectorSpec{ Config: otelConfig, Mode: otelv1alpha1.ModeDaemonSet, - Image: "otel/opentelemetry-collector-contrib:0.93.0", + Image: "otel/opentelemetry-collector-contrib:0.94.0", ServiceAccount: saName.Name, VolumeMounts: []apiv1.VolumeMount{ { diff --git a/internal/controller/telemetry/otel_conf_gen_test.go b/internal/controller/telemetry/otel_conf_gen_test.go index c0a12a07..d66f58d0 100644 --- a/internal/controller/telemetry/otel_conf_gen_test.go +++ b/internal/controller/telemetry/otel_conf_gen_test.go @@ -98,7 +98,7 @@ func TestOtelColConfComplex(t *testing.T) { }, Spec: v1alpha1.OtelOutputSpec{ OTLP: v1alpha1.OTLPgrpc{ - GRPCClientSettings: v1alpha1.GRPCClientSettings{ + ClientConfig: v1alpha1.ClientConfig{ Endpoint: "receiver-collector.example-tenant-ns.svc.cluster.local:4317", TLSSetting: v1alpha1.TLSClientSetting{ Insecure: true, @@ -114,7 +114,7 @@ func TestOtelColConfComplex(t *testing.T) { }, Spec: v1alpha1.OtelOutputSpec{ OTLP: v1alpha1.OTLPgrpc{ - GRPCClientSettings: v1alpha1.GRPCClientSettings{ + ClientConfig: v1alpha1.ClientConfig{ Endpoint: "receiver-collector.example-tenant-ns.svc.cluster.local:4317", TLSSetting: v1alpha1.TLSClientSetting{ Insecure: true,