choose default values upon incorrect storage_class value (#16058)

This commit is contained in:
Harshavardhana 2022-11-12 10:18:21 -08:00 committed by GitHub
parent 6d76db9d6c
commit 962d1f1a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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