From 962d1f1a715c5d32b4fc12a662ebe49db3f5b39a Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 12 Nov 2022 10:18:21 -0800 Subject: [PATCH] choose default values upon incorrect storage_class value (#16058) --- internal/config/storageclass/storage-class.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/config/storageclass/storage-class.go b/internal/config/storageclass/storage-class.go index ba6d69e43..eb1b871e0 100644 --- a/internal/config/storageclass/storage-class.go +++ b/internal/config/storageclass/storage-class.go @@ -304,7 +304,12 @@ func LookupConfig(kvs config.KVS, setDriveCount int) (cfg Config, err error) { // Validation is done after parsing both the storage classes. This is needed because we need one // storage class value to deduce the correct value of the other storage class. if err = validateParity(cfg.Standard.Parity, cfg.RRS.Parity, setDriveCount); err != nil { - return Config{}, err + cfg.RRS.Parity = defaultRRSParity + if setDriveCount == 1 { + cfg.RRS.Parity = 0 + } + cfg.Standard.Parity = DefaultParityBlocks(setDriveCount) + return cfg, err } return cfg, nil