Chore: Check version compatibilty when installing a plugin (#92200)

This commit is contained in:
Andres Martinez Gotor
2024-08-22 13:47:00 +02:00
committed by GitHub
parent f188da7b65
commit 1b336e94c8
7 changed files with 89 additions and 35 deletions
+7 -4
View File
@@ -174,7 +174,8 @@ func mockPluginVersionsAPI(t *testing.T, data srvData) *httptest.Server {
"sha256": "%s"
}
},
"url": "%s"
"url": "%s",
"isCompatible": true
}]
}
`, data.version, platform, data.sha, data.url),
@@ -192,15 +193,17 @@ func mockPluginVersionsAPI(t *testing.T, data srvData) *httptest.Server {
}
type versionArg struct {
version string
arch []string
version string
arch []string
isCompatible *bool
}
func createPluginVersions(versions ...versionArg) []Version {
vs := make([]Version, len(versions))
for i, version := range versions {
ver := Version{
Version: version.version,
Version: version.version,
IsCompatible: version.isCompatible,
}
if version.arch != nil {
ver.Arch = map[string]ArchMeta{}