fix: handle a crash when AskDisks is set to -1 (#10777)

This commit is contained in:
Harshavardhana
2020-10-29 09:25:43 -07:00
committed by GitHub
parent e0655e24f2
commit 4bf90ca67f
4 changed files with 13 additions and 13 deletions

View File

@@ -852,6 +852,10 @@ func (client *peerRESTClient) ConsoleLog(logCh chan interface{}, doneCh <-chan s
// but 'all' will contain nil entry for local client.
// The 'all' slice will be in the same order across the cluster.
func newPeerRestClients(endpoints EndpointServerSets) (remote, all []*peerRESTClient) {
if !globalIsDistErasure {
// Only useful in distributed setups
return nil, nil
}
hosts := endpoints.hostsSorted()
remote = make([]*peerRESTClient, 0, len(hosts))
all = make([]*peerRESTClient, len(hosts))