Use global HTTP client whenever applicable (#2682)

This commit is contained in:
Harshavardhana
2023-02-27 17:19:56 -08:00
committed by GitHub
parent 372852ee86
commit dd913decc6
9 changed files with 40 additions and 58 deletions

View File

@@ -19,11 +19,11 @@ package cluster
import (
"io/ioutil"
"net"
"net/http"
"strings"
"time"
xhttp "github.com/minio/console/pkg/http"
"github.com/minio/console/restapi"
"github.com/minio/console/pkg/utils"
@@ -69,11 +69,11 @@ func GetMinioImage() (*string, error) {
if image != "" {
return &image, nil
}
client := restapi.GetConsoleHTTPClient("")
client.Timeout = 5 * time.Second
latestMinIOImage, errLatestMinIOImage := utils.GetLatestMinIOImage(
&xhttp.Client{
Client: &http.Client{
Timeout: 5 * time.Second,
},
Client: client,
})
if errLatestMinIOImage != nil {