From 14cb59767c303af7ed43afe127df69c15df5f59c Mon Sep 17 00:00:00 2001 From: Anson Liu Date: Fri, 13 Jun 2025 10:40:02 +0000 Subject: [PATCH] Validate region value in Kinesis Output plugin Signed-off-by: Anson Liu --- apis/fluentbit/v1alpha2/plugins/output/kinesis_types.go | 2 ++ .../crds/fluentbit.fluent.io_clusteroutputs.yaml | 1 + .../fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml | 1 + config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml | 1 + config/crd/bases/fluentbit.fluent.io_outputs.yaml | 1 + manifests/setup/fluent-operator-crd.yaml | 2 ++ manifests/setup/setup.yaml | 2 ++ 7 files changed, 10 insertions(+) diff --git a/apis/fluentbit/v1alpha2/plugins/output/kinesis_types.go b/apis/fluentbit/v1alpha2/plugins/output/kinesis_types.go index 2fd0347a9..d10ab726e 100644 --- a/apis/fluentbit/v1alpha2/plugins/output/kinesis_types.go +++ b/apis/fluentbit/v1alpha2/plugins/output/kinesis_types.go @@ -15,6 +15,8 @@ import ( // https://github.com/aws/amazon-kinesis-streams-for-fluent-bit
type Kinesis struct { // The AWS region. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 Region string `json:"region"` // The name of the Kinesis Streams Delivery stream that you want log records sent to. Stream string `json:"stream"` 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 1075635e6..e67e4c24e 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 @@ -2109,6 +2109,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access). 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 60e175877..cc92a6242 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 @@ -2109,6 +2109,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access). diff --git a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml index 1075635e6..e67e4c24e 100644 --- a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml @@ -2109,6 +2109,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access). diff --git a/config/crd/bases/fluentbit.fluent.io_outputs.yaml b/config/crd/bases/fluentbit.fluent.io_outputs.yaml index 60e175877..cc92a6242 100644 --- a/config/crd/bases/fluentbit.fluent.io_outputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_outputs.yaml @@ -2109,6 +2109,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access). diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index d5e91f812..81de0e8e9 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -6245,6 +6245,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access). @@ -35143,6 +35144,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access). diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index 3cffd6ce2..26e7a9d0a 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -6245,6 +6245,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access). @@ -35143,6 +35144,7 @@ spec: type: string region: description: The AWS region. + minLength: 1 type: string roleARN: description: ARN of an IAM role to assume (for cross account access).