mirror of https://github.com/minio/minio.git
support 'admin update' for hotfix versions (#15308)
hotfixed versions are rejected as invalid, allow `mc admin update` from hotfix repos.
This commit is contained in:
parent
1cd6713e24
commit
5ac6d91525
|
@ -76,7 +76,7 @@ func releaseTimeToReleaseTag(releaseTime time.Time) string {
|
|||
// releaseTagToReleaseTime - reverse of `releaseTimeToReleaseTag()`
|
||||
func releaseTagToReleaseTime(releaseTag string) (releaseTime time.Time, err error) {
|
||||
fields := strings.Split(releaseTag, ".")
|
||||
if len(fields) < 2 || len(fields) > 3 {
|
||||
if len(fields) < 2 || len(fields) > 4 {
|
||||
return releaseTime, fmt.Errorf("%s is not a valid release tag", releaseTag)
|
||||
}
|
||||
if fields[0] != "RELEASE" {
|
||||
|
|
|
@ -72,6 +72,14 @@ func TestReleaseTagToNFromTimeConversion(t *testing.T) {
|
|||
time.Now().UTC(), "DEVELOPMENT.GOGET",
|
||||
"DEVELOPMENT.GOGET is not a valid release tag",
|
||||
},
|
||||
{
|
||||
time.Date(2017, time.August, 5, 0, 0, 53, 0, utcLoc),
|
||||
"RELEASE.2017-08-05T00-00-53Z.hotfix", "",
|
||||
},
|
||||
{
|
||||
time.Date(2017, time.August, 5, 0, 0, 53, 0, utcLoc),
|
||||
"RELEASE.2017-08-05T00-00-53Z.hotfix.aaaa", "",
|
||||
},
|
||||
}
|
||||
for i, testCase := range testCases {
|
||||
if testCase.errStr != "" {
|
||||
|
|
Loading…
Reference in New Issue