From ddb5d7043ad00a731c529a88f80730d8c66ce9fc Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 16 Jan 2021 17:32:25 -0800 Subject: [PATCH] fix: standard storage class is allowed to be '0' --- cmd/config/storageclass/storage-class.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cmd/config/storageclass/storage-class.go b/cmd/config/storageclass/storage-class.go index 305753f84..3fde56f94 100644 --- a/cmd/config/storageclass/storage-class.go +++ b/cmd/config/storageclass/storage-class.go @@ -175,20 +175,16 @@ func parseStorageClass(storageClassEnv string) (sc StorageClass, err error) { // Validates the parity disks. func validateParity(ssParity, rrsParity, setDriveCount int) (err error) { - if ssParity == 0 && rrsParity == 0 { - return nil - } - // SS parity disks should be greater than or equal to minParityDisks. // Parity below minParityDisks is not supported. - if ssParity < minParityDisks { + if ssParity > 0 && ssParity < minParityDisks { return fmt.Errorf("Standard storage class parity %d should be greater than or equal to %d", ssParity, minParityDisks) } // RRS parity disks should be greater than or equal to minParityDisks. // Parity below minParityDisks is not supported. - if rrsParity < minParityDisks { + if rrsParity > 0 && rrsParity < minParityDisks { return fmt.Errorf("Reduced redundancy storage class parity %d should be greater than or equal to %d", rrsParity, minParityDisks) } @@ -201,7 +197,7 @@ func validateParity(ssParity, rrsParity, setDriveCount int) (err error) { } if ssParity > 0 && rrsParity > 0 { - if ssParity < rrsParity { + if ssParity > 0 && ssParity < rrsParity { return fmt.Errorf("Standard storage class parity disks %d should be greater than or equal to Reduced redundancy storage class parity disks %d", ssParity, rrsParity) } }