add fips build support for mc
This commit is contained in:
+7
-18
@@ -77,17 +77,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
// Newer official download info URLs appear earlier below.
|
||||
mcReleaseInfoURLs = []string{
|
||||
mcReleaseURL + "mc.sha256sum",
|
||||
mcReleaseURL + "mc.shasum",
|
||||
}
|
||||
|
||||
// For windows our files have .exe additionally.
|
||||
mcReleaseWindowsInfoURLs = []string{
|
||||
mcReleaseURL + "mc.exe.sha256sum",
|
||||
mcReleaseURL + "mc.exe.shasum",
|
||||
}
|
||||
mcReleaseWindowsInfoURL = mcReleaseURL + "mc.exe.sha256sum"
|
||||
)
|
||||
|
||||
// mcVersionToReleaseTime - parses a standard official release
|
||||
@@ -264,18 +255,16 @@ func downloadReleaseURL(releaseChecksumURL string, timeout time.Duration) (conte
|
||||
|
||||
// DownloadReleaseData - downloads release data from mc official server.
|
||||
func DownloadReleaseData(timeout time.Duration) (data string, err *probe.Error) {
|
||||
releaseURLs := mcReleaseInfoURLs
|
||||
releaseURL := mcReleaseInfoURL
|
||||
if runtime.GOOS == "windows" {
|
||||
releaseURLs = mcReleaseWindowsInfoURLs
|
||||
releaseURL = mcReleaseWindowsInfoURL
|
||||
}
|
||||
return func() (data string, err *probe.Error) {
|
||||
for _, url := range releaseURLs {
|
||||
data, err = downloadReleaseURL(url, timeout)
|
||||
if err == nil {
|
||||
return data, nil
|
||||
}
|
||||
data, err = downloadReleaseURL(releaseURL, timeout)
|
||||
if err == nil {
|
||||
return data, nil
|
||||
}
|
||||
return data, err.Trace(releaseURLs...)
|
||||
return data, err.Trace(releaseURL)
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2015-2021 MinIO, Inc.
|
||||
//
|
||||
// This file is part of MinIO Object Storage stack
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// +build fips
|
||||
|
||||
package cmd
|
||||
|
||||
// Newer official download info URLs appear earlier below.
|
||||
var mcReleaseInfoURL = mcReleaseURL + "mc.fips.sha256sum"
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2015-2021 MinIO, Inc.
|
||||
//
|
||||
// This file is part of MinIO Object Storage stack
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// +build !fips
|
||||
|
||||
package cmd
|
||||
|
||||
// Newer official download info URLs appear earlier below.
|
||||
var mcReleaseInfoURL = mcReleaseURL + "mc.sha256sum"
|
||||
Reference in New Issue
Block a user