From 457200b0e5702497b57251907e73dfe5d721a3db Mon Sep 17 00:00:00 2001 From: Onecer Date: Wed, 17 Apr 2024 11:56:47 +0800 Subject: [PATCH] achieve an effect similar to embedding by using anonymous structs Signed-off-by: Onecer --- .../fluentbit/v1alpha2/clustermultilineparser_types.go | 2 +- .../crds/fluentbit.fluent.io_clusteroutputs.yaml | 3 +++ .../crds/fluentbit.fluent.io_outputs.yaml | 3 +++ .../templates/fluent-operator-clusterRole.yaml | 7 ++++++- .../crd/bases/fluentbit.fluent.io_clusteroutputs.yaml | 3 +++ config/crd/bases/fluentbit.fluent.io_outputs.yaml | 3 +++ docs/plugins/fluentbit/output/s3.md | 1 + go.mod | 4 ++++ go.sum | 10 ++++++++++ manifests/setup/fluent-operator-crd.yaml | 6 ++++++ manifests/setup/setup.yaml | 6 ++++++ 11 files changed, 46 insertions(+), 2 deletions(-) diff --git a/apis/fluentbit/v1alpha2/clustermultilineparser_types.go b/apis/fluentbit/v1alpha2/clustermultilineparser_types.go index eaac76fe1..dfb61a51d 100644 --- a/apis/fluentbit/v1alpha2/clustermultilineparser_types.go +++ b/apis/fluentbit/v1alpha2/clustermultilineparser_types.go @@ -30,7 +30,7 @@ import ( // +kubebuilder:object:generate:=true type MultilineParserSpec struct { - MultilineParser *multilineparser.MultilineParser `json:",inline"` + *multilineparser.MultilineParser `json:",inline"` } // +kubebuilder:object:root=true diff --git a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml index 84723d69b..d32f7cc50 100644 --- a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml +++ b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml @@ -2483,6 +2483,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string diff --git a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml index 1a3c71f4c..3949e9bce 100644 --- a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml +++ b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml @@ -2483,6 +2483,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string diff --git a/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml b/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml index 7fc48bc44..7418404a3 100644 --- a/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml +++ b/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml @@ -57,11 +57,16 @@ rules: - clusteroutputs - clusteroutputs/finalizers - clusterparsers + - clusterparsers/finalizers - fluentbitconfigs + - fluentbitconfigs/finalizers + - multilineparsers + - multilineparsers/finalizers + - clustermultilineparsers + - clustermultilineparsers/finalizers - filters - outputs - parsers - - clusterparsers/finalizers verbs: - create - delete diff --git a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml index 84723d69b..d32f7cc50 100644 --- a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml @@ -2483,6 +2483,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string diff --git a/config/crd/bases/fluentbit.fluent.io_outputs.yaml b/config/crd/bases/fluentbit.fluent.io_outputs.yaml index 1a3c71f4c..3949e9bce 100644 --- a/config/crd/bases/fluentbit.fluent.io_outputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_outputs.yaml @@ -2483,6 +2483,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string diff --git a/docs/plugins/fluentbit/output/s3.md b/docs/plugins/fluentbit/output/s3.md index b08ab5c11..39f014e69 100644 --- a/docs/plugins/fluentbit/output/s3.md +++ b/docs/plugins/fluentbit/output/s3.md @@ -31,4 +31,5 @@ The S3 output plugin, allows to flush your records into a S3 time series databas | StorageClass | Specify the storage class for S3 objects. If this option is not specified, objects will be stored with the default 'STANDARD' storage class. | string | | RetryLimit | Integer value to set the maximum number of retries allowed. | *int32 | | ExternalId | Specify an external ID for the STS API, can be used with the role_arn parameter if your role requires an external ID. | string | +| Profile | Option to specify an AWS Profile for credentials. | string | | tls | | *[plugins.TLS](../tls.md) | diff --git a/go.mod b/go.mod index 481d1563a..4feb9d3ae 100644 --- a/go.mod +++ b/go.mod @@ -59,12 +59,14 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.24.0 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.12.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect @@ -73,7 +75,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.26.1 // indirect + k8s.io/code-generator v0.26.1 // indirect k8s.io/component-base v0.26.1 // indirect + k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index b6188aca6..f2420913d 100644 --- a/go.sum +++ b/go.sum @@ -89,6 +89,7 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= @@ -355,6 +356,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -510,6 +513,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -648,8 +652,13 @@ k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s= k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= +k8s.io/code-generator v0.26.1 h1:dusFDsnNSKlMFYhzIM0jAO1OlnTN5WYwQQ+Ai12IIlo= +k8s.io/code-generator v0.26.1/go.mod h1:OMoJ5Dqx1wgaQzKgc+ZWaZPfGjdRq/Y3WubFrZmeI3I= k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4= k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= @@ -665,5 +674,6 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index 17abf4a12..69259298c 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -5123,6 +5123,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string @@ -28752,6 +28755,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index a3c00445a..845c0f7fd 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -5123,6 +5123,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string @@ -28752,6 +28755,9 @@ spec: a later chunk, resulting in data shuffling. This feature prevents this shuffling by using a queue logic for uploads. type: boolean + Profile: + description: Option to specify an AWS Profile for credentials. + type: string Region: description: The AWS region of your S3 bucket type: string