From 6c576a4178014302119c42021fcd887f71a71d5d Mon Sep 17 00:00:00 2001 From: juicer Date: Sat, 23 Sep 2023 23:53:41 -0700 Subject: [PATCH 01/12] add in_sample plugin types Signed-off-by: juicer --- apis/fluentd/v1alpha1/plugins/input/sample.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 apis/fluentd/v1alpha1/plugins/input/sample.go diff --git a/apis/fluentd/v1alpha1/plugins/input/sample.go b/apis/fluentd/v1alpha1/plugins/input/sample.go new file mode 100644 index 000000000..7b2319516 --- /dev/null +++ b/apis/fluentd/v1alpha1/plugins/input/sample.go @@ -0,0 +1,14 @@ +package input + +type Sample struct { + // The tag of the event. The value is the tag assigned to the generated events. + Tag *string `json:"tag,omitempty"` + // The number of events in the event stream of each emit. + Size *int32 `json:"size,omitempty"` + // It configures how many events to generate per second. + Rate *int32 `json:"rate,omitempty"` + // If specified, each generated event has an auto-incremented key field. + AutoIncrementKey *string `json:"auto_increment_key,omitempty"` + // The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order. + Sample *string `json:"sample,omitempty"` +} From 585216af419d3479c122667787e459154cf3a6fc Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 00:18:59 -0700 Subject: [PATCH 02/12] add in_sample plugin types and functions Signed-off-by: juicer --- apis/fluentd/v1alpha1/plugins/input/types.go | 27 +++++++++++++++++++ apis/fluentd/v1alpha1/plugins/params/const.go | 1 + 2 files changed, 28 insertions(+) diff --git a/apis/fluentd/v1alpha1/plugins/input/types.go b/apis/fluentd/v1alpha1/plugins/input/types.go index f250b1cb2..4ce37dab9 100644 --- a/apis/fluentd/v1alpha1/plugins/input/types.go +++ b/apis/fluentd/v1alpha1/plugins/input/types.go @@ -29,6 +29,8 @@ type Input struct { Http *Http `json:"http,omitempty"` // in_tail plugin Tail *Tail `json:"tail,omitempty"` + // in_sample plugin + Sample *Sample `json:"sample,omitempty"` } // DeepCopyInto implements the DeepCopyInto interface. @@ -78,6 +80,11 @@ func (i *Input) Params(loader plugins.SecretLoader) (*params.PluginStore, error) return i.tailPlugin(ps, loader), nil } + if i.Sample != nil { + ps.InsertType(string(params.SampleInputType)) + return i.samplePlugin(ps, loader), nil + } + return nil, errors.New("you must define an input plugin") } @@ -329,4 +336,24 @@ func (i *Input) httpPlugin(parent *params.PluginStore, loader plugins.SecretLoad return parent } +func (i *Input) samplePlugin(parent *params.PluginStore, loader plugins.SecretLoader) *params.PluginStore { + sampleModel := i.Sample + if sampleModel.Tag != nil { + parent.InsertPairs("tag", fmt.Sprint(*sampleModel.Tag)) + } + if sampleModel.Rate != nil { + parent.InsertPairs("rate", fmt.Sprint(*sampleModel.Rate)) + } + if sampleModel.Size != nil { + parent.InsertPairs("size", fmt.Sprint(*sampleModel.Size)) + } + if sampleModel.AutoIncrementKey != nil { + parent.InsertPairs("auto_increment_key", fmt.Sprint(*sampleModel.AutoIncrementKey)) + } + if sampleModel.Sample != nil { + parent.InsertPairs("sample", fmt.Sprint(*sampleModel.Sample)) + } + return parent +} + var _ plugins.Plugin = &Input{} diff --git a/apis/fluentd/v1alpha1/plugins/params/const.go b/apis/fluentd/v1alpha1/plugins/params/const.go index 4c49f3cd8..2b6869a35 100644 --- a/apis/fluentd/v1alpha1/plugins/params/const.go +++ b/apis/fluentd/v1alpha1/plugins/params/const.go @@ -50,6 +50,7 @@ const ( HttpInputType InputType = "http" ForwardInputType InputType = "forward" TailInputType InputType = "tail" + SampleInputType InputType = "sample" // Enums the supported filter types RecordTransformerFilterType FilterType = "record_transformer" From 084a1e9c9d22dd06191ecc8ef0c8ed24fe12b2b7 Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 00:20:27 -0700 Subject: [PATCH 03/12] generate manifests Signed-off-by: juicer --- .../crds/fluentd.fluent.io_fluentds.yaml | 28 +++++++++++++++++++ .../crd/bases/fluentd.fluent.io_fluentds.yaml | 28 +++++++++++++++++++ manifests/setup/fluent-operator-crd.yaml | 28 +++++++++++++++++++ manifests/setup/setup.yaml | 28 +++++++++++++++++++ 4 files changed, 112 insertions(+) diff --git a/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml b/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml index f2212855e..4198959ac 100644 --- a/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml +++ b/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml @@ -2158,6 +2158,34 @@ spec: description: The @log_level parameter specifies the plugin-specific logging level type: string + sample: + description: in_sample plugin + properties: + auto_increment_key: + description: If specified, each generated event has an auto-incremented + key field. + type: string + rate: + description: It configures how many events to generate per + second. + format: int32 + type: integer + sample: + description: The sample data to be generated. It should + be either an array of JSON hashes or a single JSON hash. + If it is an array of JSON hashes, the hashes in the array + are cycled through in order. + type: string + size: + description: The number of events in the event stream of + each emit. + format: int32 + type: integer + tag: + description: The tag of the event. The value is the tag + assigned to the generated events. + type: string + type: object tail: description: in_tail plugin properties: diff --git a/config/crd/bases/fluentd.fluent.io_fluentds.yaml b/config/crd/bases/fluentd.fluent.io_fluentds.yaml index f2212855e..4198959ac 100644 --- a/config/crd/bases/fluentd.fluent.io_fluentds.yaml +++ b/config/crd/bases/fluentd.fluent.io_fluentds.yaml @@ -2158,6 +2158,34 @@ spec: description: The @log_level parameter specifies the plugin-specific logging level type: string + sample: + description: in_sample plugin + properties: + auto_increment_key: + description: If specified, each generated event has an auto-incremented + key field. + type: string + rate: + description: It configures how many events to generate per + second. + format: int32 + type: integer + sample: + description: The sample data to be generated. It should + be either an array of JSON hashes or a single JSON hash. + If it is an array of JSON hashes, the hashes in the array + are cycled through in order. + type: string + size: + description: The number of events in the event stream of + each emit. + format: int32 + type: integer + tag: + description: The tag of the event. The value is the tag + assigned to the generated events. + type: string + type: object tail: description: in_tail plugin properties: diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index 251d3efb1..62acc7995 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -20956,6 +20956,34 @@ spec: description: The @log_level parameter specifies the plugin-specific logging level type: string + sample: + description: in_sample plugin + properties: + auto_increment_key: + description: If specified, each generated event has an auto-incremented + key field. + type: string + rate: + description: It configures how many events to generate per + second. + format: int32 + type: integer + sample: + description: The sample data to be generated. It should + be either an array of JSON hashes or a single JSON hash. + If it is an array of JSON hashes, the hashes in the array + are cycled through in order. + type: string + size: + description: The number of events in the event stream of + each emit. + format: int32 + type: integer + tag: + description: The tag of the event. The value is the tag + assigned to the generated events. + type: string + type: object tail: description: in_tail plugin properties: diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index ad965f276..a7ac21302 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -20956,6 +20956,34 @@ spec: description: The @log_level parameter specifies the plugin-specific logging level type: string + sample: + description: in_sample plugin + properties: + auto_increment_key: + description: If specified, each generated event has an auto-incremented + key field. + type: string + rate: + description: It configures how many events to generate per + second. + format: int32 + type: integer + sample: + description: The sample data to be generated. It should + be either an array of JSON hashes or a single JSON hash. + If it is an array of JSON hashes, the hashes in the array + are cycled through in order. + type: string + size: + description: The number of events in the event stream of + each emit. + format: int32 + type: integer + tag: + description: The tag of the event. The value is the tag + assigned to the generated events. + type: string + type: object tail: description: in_tail plugin properties: From fa87282f16d272fbbef2184c387a177c410284ab Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 10:34:06 -0700 Subject: [PATCH 04/12] add testcase for in_dummy plugin Signed-off-by: juicer --- .../fluentd-global-cfg-input-sample.cfg | 24 +++++++++++++++++++ apis/fluentd/v1alpha1/tests/helper_test.go | 22 +++++++++++++++++ apis/fluentd/v1alpha1/tests/tools.go | 24 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 apis/fluentd/v1alpha1/tests/expected/fluentd-global-cfg-input-sample.cfg diff --git a/apis/fluentd/v1alpha1/tests/expected/fluentd-global-cfg-input-sample.cfg b/apis/fluentd/v1alpha1/tests/expected/fluentd-global-cfg-input-sample.cfg new file mode 100644 index 000000000..d6788d7e0 --- /dev/null +++ b/apis/fluentd/v1alpha1/tests/expected/fluentd-global-cfg-input-sample.cfg @@ -0,0 +1,24 @@ + + @type sample + auto_increment_key id + rate 10 + sample {"hello": "world"} + size 10 + tag foo.bar + + + @id main + @type label_router + + @label @2d9e59757d3bfc66d93c3bc44b408922 + + namespaces fluent + + + + \ No newline at end of file diff --git a/apis/fluentd/v1alpha1/tests/helper_test.go b/apis/fluentd/v1alpha1/tests/helper_test.go index d7aab0f5f..22a8ad5a2 100644 --- a/apis/fluentd/v1alpha1/tests/helper_test.go +++ b/apis/fluentd/v1alpha1/tests/helper_test.go @@ -66,6 +66,28 @@ func Test_ClusterCfgInputTail(t *testing.T) { } +func Test_ClusterCfgInputSample(t *testing.T) { + g := NewGomegaWithT(t) + sl := plugins.NewSecretLoader(nil, Fluentd.Namespace, logr.Logger{}) + + psr := fluentdv1alpha1.NewGlobalPluginResources("main") + psr.CombineGlobalInputsPlugins(sl, FluentdInputSample.Spec.GlobalInputs) + + clustercfgRouter, err := psr.BuildCfgRouter(&FluentdConfig1) + g.Expect(err).NotTo(HaveOccurred()) + clusterOutputs := []fluentdv1alpha1.ClusterOutput{FluentdClusterOutputTag} + clustercfgResources, _ := psr.PatchAndFilterClusterLevelResources(sl, FluentdConfig1.GetCfgId(), []fluentdv1alpha1.ClusterFilter{}, clusterOutputs) + err = psr.WithCfgResources(*clustercfgRouter.Label, clustercfgResources) + g.Expect(err).NotTo(HaveOccurred()) + + for i := 0; i < maxRuntimes; i++ { + config, errs := psr.RenderMainConfig(false) + // fmt.Println(config) + g.Expect(errs).NotTo(HaveOccurred()) + g.Expect(string(getExpectedCfg("./expected/fluentd-global-cfg-input-sample.cfg"))).To(Equal(config)) + } +} + func Test_ClusterCfgOutput2ES(t *testing.T) { g := NewGomegaWithT(t) sl := plugins.NewSecretLoader(nil, Fluentd.Namespace, logr.Logger{}) diff --git a/apis/fluentd/v1alpha1/tests/tools.go b/apis/fluentd/v1alpha1/tests/tools.go index 9b75a5d6e..1c958b701 100644 --- a/apis/fluentd/v1alpha1/tests/tools.go +++ b/apis/fluentd/v1alpha1/tests/tools.go @@ -35,6 +35,29 @@ spec: config.fluentd.fluent.io/enabled: "true" ` + FluentdInputSample fluentdv1alpha1.Fluentd + FluentdInputSampleRaw = ` +apiVersion: fluentd.fluent.io/v1alpha1 +kind: Fluentd +metadata: + name: fluentd + namespace: fluent + labels: + app.kubernetes.io/name: fluentd +spec: + globalInputs: + - sample: + sample: '{"hello": "world"}' + tag: "foo.bar" + rate: 10 + size: 10 + auto_increment_key: "id" + replicas: 1 + image: kubesphere/fluentd:v1.15.3 + fluentdCfgSelector: + matchLabels: + config.fluentd.fluent.io/enabled: "true" +` FluentdInputTail fluentdv1alpha1.Fluentd FluentdInputTailRaw = ` apiVersion: fluentd.fluent.io/v1alpha1 @@ -532,6 +555,7 @@ func init() { func() { ParseIntoObject(FluentdRaw, &Fluentd) ParseIntoObject(FluentdInputTailRaw, &FluentdInputTail) + ParseIntoObject(FluentdInputSampleRaw, &FluentdInputSample) ParseIntoObject(FluentdClusterOutputTagRaw, &FluentdClusterOutputTag) ParseIntoObject(FluentdClusterFluentdConfig1Raw, &FluentdClusterFluentdConfig1) ParseIntoObject(FluentdClusterFluentdConfig2Raw, &FluentdClusterFluentdConfig2) From e841524e4e3e2a2e75cada8fc3a462d8b39e38e6 Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 10:36:07 -0700 Subject: [PATCH 05/12] fmt codes Signed-off-by: juicer --- pkg/operator/collector-statefulset.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/operator/collector-statefulset.go b/pkg/operator/collector-statefulset.go index fd5f72f87..57ba118c7 100644 --- a/pkg/operator/collector-statefulset.go +++ b/pkg/operator/collector-statefulset.go @@ -120,7 +120,7 @@ func MakefbStatefulset(co fluentbitv1alpha2.Collector) *appsv1.StatefulSet { if co.Spec.Ports != nil { statefulset.Spec.Template.Spec.Containers[0].Ports = append(statefulset.Spec.Template.Spec.Containers[0].Ports, co.Spec.Ports...) } - + // Mount Secrets for _, secret := range co.Spec.Secrets { statefulset.Spec.Template.Spec.Volumes = append(statefulset.Spec.Template.Spec.Volumes, corev1.Volume{ From 5f6a4e2b035bbb4c7d80b1985a6884c834f750fd Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 10:42:37 -0700 Subject: [PATCH 06/12] update manifests Signed-off-by: juicer --- apis/fluentd/v1alpha1/plugins/input/sample.go | 5 +++-- .../charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml | 4 ++-- config/crd/bases/fluentd.fluent.io_fluentds.yaml | 4 ++-- manifests/setup/fluent-operator-crd.yaml | 4 ++-- manifests/setup/setup.yaml | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apis/fluentd/v1alpha1/plugins/input/sample.go b/apis/fluentd/v1alpha1/plugins/input/sample.go index 7b2319516..b4c0eef74 100644 --- a/apis/fluentd/v1alpha1/plugins/input/sample.go +++ b/apis/fluentd/v1alpha1/plugins/input/sample.go @@ -1,12 +1,13 @@ package input +// The in_sample input plugin generates sample events. It is useful for testing, debugging, benchmarking and getting started with Fluentd. type Sample struct { // The tag of the event. The value is the tag assigned to the generated events. Tag *string `json:"tag,omitempty"` // The number of events in the event stream of each emit. - Size *int32 `json:"size,omitempty"` + Size *int64 `json:"size,omitempty"` // It configures how many events to generate per second. - Rate *int32 `json:"rate,omitempty"` + Rate *int64 `json:"rate,omitempty"` // If specified, each generated event has an auto-incremented key field. AutoIncrementKey *string `json:"auto_increment_key,omitempty"` // The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order. diff --git a/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml b/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml index 4198959ac..2551c795a 100644 --- a/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml +++ b/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml @@ -2168,7 +2168,7 @@ spec: rate: description: It configures how many events to generate per second. - format: int32 + format: int64 type: integer sample: description: The sample data to be generated. It should @@ -2179,7 +2179,7 @@ spec: size: description: The number of events in the event stream of each emit. - format: int32 + format: int64 type: integer tag: description: The tag of the event. The value is the tag diff --git a/config/crd/bases/fluentd.fluent.io_fluentds.yaml b/config/crd/bases/fluentd.fluent.io_fluentds.yaml index 4198959ac..2551c795a 100644 --- a/config/crd/bases/fluentd.fluent.io_fluentds.yaml +++ b/config/crd/bases/fluentd.fluent.io_fluentds.yaml @@ -2168,7 +2168,7 @@ spec: rate: description: It configures how many events to generate per second. - format: int32 + format: int64 type: integer sample: description: The sample data to be generated. It should @@ -2179,7 +2179,7 @@ spec: size: description: The number of events in the event stream of each emit. - format: int32 + format: int64 type: integer tag: description: The tag of the event. The value is the tag diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index 62acc7995..adb7dc6ce 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -20966,7 +20966,7 @@ spec: rate: description: It configures how many events to generate per second. - format: int32 + format: int64 type: integer sample: description: The sample data to be generated. It should @@ -20977,7 +20977,7 @@ spec: size: description: The number of events in the event stream of each emit. - format: int32 + format: int64 type: integer tag: description: The tag of the event. The value is the tag diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index a7ac21302..b7417a5b0 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -20966,7 +20966,7 @@ spec: rate: description: It configures how many events to generate per second. - format: int32 + format: int64 type: integer sample: description: The sample data to be generated. It should @@ -20977,7 +20977,7 @@ spec: size: description: The number of events in the event stream of each emit. - format: int32 + format: int64 type: integer tag: description: The tag of the event. The value is the tag From 82ff471575b32c5ac799c4eb461506ed37a3c881 Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 10:53:22 -0700 Subject: [PATCH 07/12] update documents Signed-off-by: juicer --- docs/plugins/fluentd/input/dummy.md | 15 +++++++++++++++ docs/plugins/fluentd/input/types.md | 1 + 2 files changed, 16 insertions(+) create mode 100644 docs/plugins/fluentd/input/dummy.md diff --git a/docs/plugins/fluentd/input/dummy.md b/docs/plugins/fluentd/input/dummy.md new file mode 100644 index 000000000..a0a1a95af --- /dev/null +++ b/docs/plugins/fluentd/input/dummy.md @@ -0,0 +1,15 @@ +# Sample + +The in_sample input plugin generates sample events. It is useful for testing, debugging, benchmarking and getting started with Fluentd. + +This plugin is the renamed version of in_dummy. + + +| Field | Description | Scheme | +| ----- | ----------- | ------ | +| tag | The tag assigned to the generated events | *string | +| size | The number of events in the event stream of each emit | *int64 | +| rate | how many events to generate per second | *int64 | +| auto_increment_key | generated event will have an auto-incremented key field| *string | +| sample | The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order | *string | + diff --git a/docs/plugins/fluentd/input/types.md b/docs/plugins/fluentd/input/types.md index 7f569b8af..72449d187 100644 --- a/docs/plugins/fluentd/input/types.md +++ b/docs/plugins/fluentd/input/types.md @@ -18,3 +18,4 @@ Input defines all available input plugins and their parameters | forward | in_forward plugin | *Forward | | http | in_http plugin | *Http | | tail | in_tail plugin | *Tail | +| sample| in_sample plugin | *Sample | From 6974a9c37103a749f8cbcec0380dabc045259e0d Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 11:07:49 -0700 Subject: [PATCH 08/12] fix document filename Signed-off-by: juicer --- docs/plugins/fluentd/input/{dummy.md => sample.md} | 13 +++++-------- docs/plugins/fluentd/input/types.md | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) rename docs/plugins/fluentd/input/{dummy.md => sample.md} (52%) diff --git a/docs/plugins/fluentd/input/dummy.md b/docs/plugins/fluentd/input/sample.md similarity index 52% rename from docs/plugins/fluentd/input/dummy.md rename to docs/plugins/fluentd/input/sample.md index a0a1a95af..05ef5857e 100644 --- a/docs/plugins/fluentd/input/dummy.md +++ b/docs/plugins/fluentd/input/sample.md @@ -2,14 +2,11 @@ The in_sample input plugin generates sample events. It is useful for testing, debugging, benchmarking and getting started with Fluentd. -This plugin is the renamed version of in_dummy. - | Field | Description | Scheme | | ----- | ----------- | ------ | -| tag | The tag assigned to the generated events | *string | -| size | The number of events in the event stream of each emit | *int64 | -| rate | how many events to generate per second | *int64 | -| auto_increment_key | generated event will have an auto-incremented key field| *string | -| sample | The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order | *string | - +| tag | The tag of the event. The value is the tag assigned to the generated events. | *string | +| size | The number of events in the event stream of each emit. | *int64 | +| rate | It configures how many events to generate per second. | *int64 | +| auto_increment_key | If specified, each generated event has an auto-incremented key field. | *string | +| sample | The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order. | *string | diff --git a/docs/plugins/fluentd/input/types.md b/docs/plugins/fluentd/input/types.md index 72449d187..75e3e9b30 100644 --- a/docs/plugins/fluentd/input/types.md +++ b/docs/plugins/fluentd/input/types.md @@ -18,4 +18,4 @@ Input defines all available input plugins and their parameters | forward | in_forward plugin | *Forward | | http | in_http plugin | *Http | | tail | in_tail plugin | *Tail | -| sample| in_sample plugin | *Sample | +| sample | in_sample plugin | *Sample | From e07ab57cd80caa82df42de538d0784f3594daea6 Mon Sep 17 00:00:00 2001 From: juicer Date: Sun, 24 Sep 2023 11:22:07 -0700 Subject: [PATCH 09/12] fix test config yaml format. Signed-off-by: juicer --- apis/fluentd/v1alpha1/tests/tools.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/fluentd/v1alpha1/tests/tools.go b/apis/fluentd/v1alpha1/tests/tools.go index 1c958b701..af9b142af 100644 --- a/apis/fluentd/v1alpha1/tests/tools.go +++ b/apis/fluentd/v1alpha1/tests/tools.go @@ -55,8 +55,8 @@ spec: replicas: 1 image: kubesphere/fluentd:v1.15.3 fluentdCfgSelector: - matchLabels: - config.fluentd.fluent.io/enabled: "true" + matchLabels: + config.fluentd.fluent.io/enabled: "true" ` FluentdInputTail fluentdv1alpha1.Fluentd FluentdInputTailRaw = ` From 6c8d91e8ffc8e240a53f214402fe0243be77d8ba Mon Sep 17 00:00:00 2001 From: juicer Date: Fri, 6 Oct 2023 19:50:00 -0700 Subject: [PATCH 10/12] fix and follow camelCase Signed-off-by: juicer --- apis/fluentd/v1alpha1/plugins/input/sample.go | 2 +- apis/fluentd/v1alpha1/tests/tools.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/fluentd/v1alpha1/plugins/input/sample.go b/apis/fluentd/v1alpha1/plugins/input/sample.go index b4c0eef74..22d0e097a 100644 --- a/apis/fluentd/v1alpha1/plugins/input/sample.go +++ b/apis/fluentd/v1alpha1/plugins/input/sample.go @@ -9,7 +9,7 @@ type Sample struct { // It configures how many events to generate per second. Rate *int64 `json:"rate,omitempty"` // If specified, each generated event has an auto-incremented key field. - AutoIncrementKey *string `json:"auto_increment_key,omitempty"` + AutoIncrementKey *string `json:"autoIncrementKey,omitempty"` // The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order. Sample *string `json:"sample,omitempty"` } diff --git a/apis/fluentd/v1alpha1/tests/tools.go b/apis/fluentd/v1alpha1/tests/tools.go index af9b142af..b053c3e1e 100644 --- a/apis/fluentd/v1alpha1/tests/tools.go +++ b/apis/fluentd/v1alpha1/tests/tools.go @@ -51,7 +51,7 @@ spec: tag: "foo.bar" rate: 10 size: 10 - auto_increment_key: "id" + autoIncrementKey: "id" replicas: 1 image: kubesphere/fluentd:v1.15.3 fluentdCfgSelector: From 6c1ee36b80055f4c99aa5b3e31c4c77e2553c029 Mon Sep 17 00:00:00 2001 From: juicer Date: Fri, 6 Oct 2023 19:50:49 -0700 Subject: [PATCH 11/12] regenerate crds Signed-off-by: juicer --- .../charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml | 2 +- config/crd/bases/fluentd.fluent.io_fluentds.yaml | 2 +- manifests/setup/fluent-operator-crd.yaml | 2 +- manifests/setup/setup.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml b/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml index 2551c795a..52061bd62 100644 --- a/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml +++ b/charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_fluentds.yaml @@ -2161,7 +2161,7 @@ spec: sample: description: in_sample plugin properties: - auto_increment_key: + autoIncrementKey: description: If specified, each generated event has an auto-incremented key field. type: string diff --git a/config/crd/bases/fluentd.fluent.io_fluentds.yaml b/config/crd/bases/fluentd.fluent.io_fluentds.yaml index 2551c795a..52061bd62 100644 --- a/config/crd/bases/fluentd.fluent.io_fluentds.yaml +++ b/config/crd/bases/fluentd.fluent.io_fluentds.yaml @@ -2161,7 +2161,7 @@ spec: sample: description: in_sample plugin properties: - auto_increment_key: + autoIncrementKey: description: If specified, each generated event has an auto-incremented key field. type: string diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index adb7dc6ce..114a44c9d 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -20959,7 +20959,7 @@ spec: sample: description: in_sample plugin properties: - auto_increment_key: + autoIncrementKey: description: If specified, each generated event has an auto-incremented key field. type: string diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index b7417a5b0..8f326c186 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -20959,7 +20959,7 @@ spec: sample: description: in_sample plugin properties: - auto_increment_key: + autoIncrementKey: description: If specified, each generated event has an auto-incremented key field. type: string From e958fedf5c6b1e94029ffb748749c076b94f67e8 Mon Sep 17 00:00:00 2001 From: juicer Date: Fri, 6 Oct 2023 19:52:07 -0700 Subject: [PATCH 12/12] fix docs Signed-off-by: juicer --- docs/plugins/fluentd/input/sample.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/fluentd/input/sample.md b/docs/plugins/fluentd/input/sample.md index 05ef5857e..2ee52a9b4 100644 --- a/docs/plugins/fluentd/input/sample.md +++ b/docs/plugins/fluentd/input/sample.md @@ -8,5 +8,5 @@ The in_sample input plugin generates sample events. It is useful for testing, de | tag | The tag of the event. The value is the tag assigned to the generated events. | *string | | size | The number of events in the event stream of each emit. | *int64 | | rate | It configures how many events to generate per second. | *int64 | -| auto_increment_key | If specified, each generated event has an auto-incremented key field. | *string | +| autoIncrementKey | If specified, each generated event has an auto-incremented key field. | *string | | sample | The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order. | *string |