ignore server version for cloud instances (#16782)

Этот коммит содержится в:
Eli Yukelzon
2021-01-26 02:47:04 +02:00
коммит произвёл GitHub
родитель 899d60ad41
Коммит dc6a8711b9
2 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@@ -95,7 +95,7 @@ func noticeMatchesConditions(config *model.Config, preferences store.PreferenceS
}
// check if current server version is notice range
if cnd.ServerVersion != nil {
if !isCloud && cnd.ServerVersion != nil {
version := cleanupVersion(model.BuildNumber)
serverVersion, err := semver.NewVersion(version)
if err != nil {

Просмотреть файл

@@ -283,6 +283,20 @@ func TestNoticeValidation(t *testing.T) {
wantErr: 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",