From a01624738d4e1ebeb3727f894b9206fca503dd5f Mon Sep 17 00:00:00 2001 From: Pedro Juarez Date: Tue, 11 Jun 2024 19:48:25 -0700 Subject: [PATCH] Bugfix: Pool name should not be empty (#2158) Starting v5.0.15 Pool Name is required, but the CRD used allow empty `spec.pools.*.name` field --- helm/operator/templates/minio.min.io_tenants.yaml | 1 + pkg/apis/minio.min.io/v2/types.go | 3 ++- resources/base/crds/minio.min.io_tenants.yaml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/helm/operator/templates/minio.min.io_tenants.yaml b/helm/operator/templates/minio.min.io_tenants.yaml index fbaf7a6a333..076f2add230 100644 --- a/helm/operator/templates/minio.min.io_tenants.yaml +++ b/helm/operator/templates/minio.min.io_tenants.yaml @@ -3069,6 +3069,7 @@ spec: type: string type: object name: + minLength: 1 type: string nodeSelector: additionalProperties: diff --git a/pkg/apis/minio.min.io/v2/types.go b/pkg/apis/minio.min.io/v2/types.go index 1c6d8806044..3f6559e2971 100644 --- a/pkg/apis/minio.min.io/v2/types.go +++ b/pkg/apis/minio.min.io/v2/types.go @@ -617,7 +617,8 @@ type CustomCertificateConfig struct { // See the https://min.io/docs/minio/kubernetes/upstream/operations/install-deploy-manage/deploy-minio-tenant.html#procedure-command-line[MinIO Operator CRD] reference for the `pools` object for examples and more complete documentation. + type Pool struct { // *Required* - // + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 // Specify the name of the pool. The Operator automatically generates the pool name if this field is omitted. Name string `json:"name"` // *Required* diff --git a/resources/base/crds/minio.min.io_tenants.yaml b/resources/base/crds/minio.min.io_tenants.yaml index fbaf7a6a333..076f2add230 100644 --- a/resources/base/crds/minio.min.io_tenants.yaml +++ b/resources/base/crds/minio.min.io_tenants.yaml @@ -3069,6 +3069,7 @@ spec: type: string type: object name: + minLength: 1 type: string nodeSelector: additionalProperties: