From 839f8d60ddb6a31e19294a367bec135e92bc6fd2 Mon Sep 17 00:00:00 2001 From: parth-gr Date: Wed, 15 Mar 2023 23:05:19 +0530 Subject: [PATCH] rgw: don't validate objectstore lenght when cluster is external validate the object store name only if it is not an external cluster as external cluster won't create the rgw daemon and it's other resource and there is some legacy external cluster which has more lenght of objectstore so to run them successfully we are not validating the objectstore name Signed-off-by: parth-gr --- pkg/apis/ceph.rook.io/v1/object.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/apis/ceph.rook.io/v1/object.go b/pkg/apis/ceph.rook.io/v1/object.go index 23d787147..47161d3cc 100644 --- a/pkg/apis/ceph.rook.io/v1/object.go +++ b/pkg/apis/ceph.rook.io/v1/object.go @@ -81,8 +81,15 @@ func ValidateObjectSpec(gs *CephObjectStore) error { if gs.Namespace == "" { return errors.New("missing namespace") } - if len(gs.Name) > objectStoreNameMaxLen { - return errors.New("object store name cannot be longer than 38 characters") + + // validate the object store name only if it is not an external cluster + // as external cluster won't create the rgw daemon and it's other resources + // and there is some legacy external cluster which has more length of objectstore + // so to run them successfully we are not validating the objectstore name + if !gs.Spec.IsExternal() { + if len(gs.Name) > objectStoreNameMaxLen { + return errors.New("object store name cannot be longer than 38 characters") + } } securePort := gs.Spec.Gateway.SecurePort if securePort < 0 || securePort > 65535 {