From 76a67cee8ac4d4b8f61c42ec07c44b6c0585d807 Mon Sep 17 00:00:00 2001 From: withlin Date: Mon, 9 Dec 2024 21:11:13 +0800 Subject: [PATCH] fix: some nits Signed-off-by: withlin Signed-off-by: withlin --- docs/configuration/plugins/outputs/kafka.md | 4 +++- pkg/sdk/logging/model/output/kafka.go | 5 +++-- pkg/sdk/logging/model/output/zz_generated.deepcopy.go | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/configuration/plugins/outputs/kafka.md b/docs/configuration/plugins/outputs/kafka.md index a23b83c09..0ff4629c2 100644 --- a/docs/configuration/plugins/outputs/kafka.md +++ b/docs/configuration/plugins/outputs/kafka.md @@ -184,7 +184,9 @@ Password when using PLAIN/SCRAM SASL authentication ### principal (string, optional) {#kafka-principal} -### rdkafka_options (RdkafkaOptions, optional) {#kafka-rdkafka_options} +### rdkafka_options (*RdkafkaOptions, optional) {#kafka-rdkafka_options} + +RdkafkaOptions represents the global configuration properties for librdkafka. ### required_acks (int, optional) {#kafka-required_acks} diff --git a/pkg/sdk/logging/model/output/kafka.go b/pkg/sdk/logging/model/output/kafka.go index fb91d34c3..87043b8ac 100644 --- a/pkg/sdk/logging/model/output/kafka.go +++ b/pkg/sdk/logging/model/output/kafka.go @@ -65,8 +65,9 @@ type _metaKafka interface{} //nolint:deadcode,unused // -[more info](https://github.com/fluent/fluent-plugin-kafka#output-plugin) type KafkaOutputConfig struct { // Use rdkafka2 instead of the legacy kafka2 output plugin. This plugin requires fluentd image version v1.16-4.9-full or higher. - UseRdkafka bool `json:"use_rdkafka,omitempty"` - RdkafkaOptions RdkafkaOptions `json:"rdkafka_options,omitempty"` + UseRdkafka bool `json:"use_rdkafka,omitempty"` + // RdkafkaOptions represents the global configuration properties for librdkafka. + RdkafkaOptions *RdkafkaOptions `json:"rdkafka_options,omitempty"` // The list of all seed brokers, with their host and port information. Brokers string `json:"brokers"` // Topic Key (default: "topic") diff --git a/pkg/sdk/logging/model/output/zz_generated.deepcopy.go b/pkg/sdk/logging/model/output/zz_generated.deepcopy.go index 4cfa1c85e..aaea784f6 100644 --- a/pkg/sdk/logging/model/output/zz_generated.deepcopy.go +++ b/pkg/sdk/logging/model/output/zz_generated.deepcopy.go @@ -692,7 +692,11 @@ func (in *HTTPOutputConfig) DeepCopy() *HTTPOutputConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KafkaOutputConfig) DeepCopyInto(out *KafkaOutputConfig) { *out = *in - out.RdkafkaOptions = in.RdkafkaOptions + if in.RdkafkaOptions != nil { + in, out := &in.RdkafkaOptions, &out.RdkafkaOptions + *out = new(RdkafkaOptions) + **out = **in + } if in.Headers != nil { in, out := &in.Headers, &out.Headers *out = make(map[string]string, len(*in))