mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 17:30:29 +08:00
远程升级API节点限制版本号必须不小于0.6.4
This commit is contained in:
@@ -67,7 +67,7 @@ func (this *Upgrader) Upgrade() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !Tea.IsTesting() /** 开发环境下允许突破此限制方便测试 **/ &&
|
if !Tea.IsTesting() /** 开发环境下允许突破此限制方便测试 **/ &&
|
||||||
(stringutil.VersionCompare(versionResp.Version, "0.6.4" /** 从0.6.4开始支持 **/) <= 0 || versionResp.Os != runtime.GOOS || versionResp.Arch != runtime.GOARCH) {
|
(stringutil.VersionCompare(versionResp.Version, "0.6.4" /** 从0.6.4开始支持 **/) < 0 || versionResp.Os != runtime.GOOS || versionResp.Arch != runtime.GOARCH) {
|
||||||
return errors.New("could not upgrade api node v" + versionResp.Version + "/" + versionResp.Os + "/" + versionResp.Arch)
|
return errors.New("could not upgrade api node v" + versionResp.Version + "/" + versionResp.Os + "/" + versionResp.Arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ func CanUpgrade(apiVersion string, osName string, arch string) (canUpgrade bool,
|
|||||||
return false, "current api version should not be empty"
|
return false, "current api version should not be empty"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if stringutil.VersionCompare(apiVersion, "0.6.4") < 0 {
|
||||||
|
return false, "api node version must greater than or equal to 0.6.4"
|
||||||
|
}
|
||||||
|
|
||||||
if osName != runtime.GOOS {
|
if osName != runtime.GOOS {
|
||||||
return false, "os not match: " + osName
|
return false, "os not match: " + osName
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user