mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Fix and cleanup update message and improve related tests (#4361)
Fixes #4232
This commit is contained in:
committed by
Harshavardhana
parent
28352f3f5d
commit
a0e02f43e1
@@ -238,13 +238,16 @@ func getDownloadURL() (downloadURL string) {
|
||||
return minioReleaseURL + "minio"
|
||||
}
|
||||
|
||||
func getUpdateInfo(timeout time.Duration, mode string) (older time.Duration, downloadURL string, err error) {
|
||||
currentReleaseTime, err := GetCurrentReleaseTime()
|
||||
func getUpdateInfo(timeout time.Duration, mode string) (older time.Duration,
|
||||
downloadURL string, err error) {
|
||||
|
||||
var currentReleaseTime, latestReleaseTime time.Time
|
||||
currentReleaseTime, err = GetCurrentReleaseTime()
|
||||
if err != nil {
|
||||
return older, downloadURL, err
|
||||
}
|
||||
|
||||
latestReleaseTime, err := getLatestReleaseTime(timeout, mode)
|
||||
latestReleaseTime, err = getLatestReleaseTime(timeout, mode)
|
||||
if err != nil {
|
||||
return older, downloadURL, err
|
||||
}
|
||||
@@ -274,8 +277,8 @@ func mainUpdate(ctx *cli.Context) {
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
if older != time.Duration(0) {
|
||||
log.Println(colorizeUpdateMessage(downloadURL, older))
|
||||
if updateMsg := computeUpdateMessage(downloadURL, older); updateMsg != "" {
|
||||
log.Println(updateMsg)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user