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 <paarora@redhat.com>
This commit is contained in:
parth-gr committed 2023-03-15 23:10:32 +05:30
1 parent ef4c4f909a
commit 839f8d60dd
1 file changed
+9 -2
+9 -2
View File
@@ -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 {