fix: move list quorum ENV to config (#10804)

This commit is contained in:
Harshavardhana
2020-11-02 17:21:56 -08:00
committed by GitHub
parent 0a796505c1
commit 4ea31da889
9 changed files with 76 additions and 53 deletions
+1 -16
View File
@@ -23,9 +23,7 @@ import (
"path"
"sync"
"github.com/minio/minio/cmd/config"
"github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/env"
)
// listPath will return the requested entries.
@@ -119,20 +117,7 @@ func (z *erasureServerSets) listPath(ctx context.Context, o listPathOptions) (en
}
if o.AskDisks == 0 {
switch env.Get("MINIO_API_LIST_STRICT_QUORUM", config.EnableOff) {
case config.EnableOn:
// If strict, ask at least 50%.
o.AskDisks = -1
case "reduced":
// Reduced safety.
o.AskDisks = 2
case "disk":
// Ask single disk.
o.AskDisks = 1
default:
// By default asks at max 3 disks.
o.AskDisks = 3
}
o.AskDisks = globalAPIConfig.getListQuorum()
}
var mu sync.Mutex