ignore server version for cloud instances (#16782)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
899d60ad41
Коммит
dc6a8711b9
@@ -95,7 +95,7 @@ func noticeMatchesConditions(config *model.Config, preferences store.PreferenceS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if current server version is notice range
|
// check if current server version is notice range
|
||||||
if cnd.ServerVersion != nil {
|
if !isCloud && cnd.ServerVersion != nil {
|
||||||
version := cleanupVersion(model.BuildNumber)
|
version := cleanupVersion(model.BuildNumber)
|
||||||
serverVersion, err := semver.NewVersion(version)
|
serverVersion, err := semver.NewVersion(version)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -283,6 +283,20 @@ func TestNoticeValidation(t *testing.T) {
|
|||||||
wantErr: false,
|
wantErr: false,
|
||||||
wantOk: false,
|
wantOk: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "notice with server version check on cloud should ignore version",
|
||||||
|
args: args{
|
||||||
|
cloud: true,
|
||||||
|
serverVersion: "cloud.54.abcdef",
|
||||||
|
notice: &model.ProductNotice{
|
||||||
|
Conditions: model.Conditions{
|
||||||
|
ServerVersion: []string{"> 99.0.0 < 100.2.2"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wantErr: false,
|
||||||
|
wantOk: true,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "notice with server version check that is invalid",
|
name: "notice with server version check that is invalid",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user