Skip to content

Commit

Permalink
feat: 安装预设插件锁定版本(closed #2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpyoung3 committed Nov 11, 2024
1 parent 1b6abd7 commit dd717e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/backend/subscription/steps/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ def get_matching_package_obj(self, os_type: str, cpu_arch: str, bk_biz_id: int)
)
if str(bk_biz_id) in plugin_version_config:
os_cpu__biz_pkg_map = self.get_biz_version(package, plugin_version_config, bk_biz_id)
package = os_cpu__biz_pkg_map[self.get_os_key(os_type, cpu_arch)]
if os_cpu__biz_pkg_map:
package = os_cpu__biz_pkg_map[self.get_os_key(os_type, cpu_arch)]
except KeyError:
msg = _("插件 [{name}] 不支持 系统:{os_type}-架构:{cpu_arch}-版本:{plugin_version}").format(
name=self.plugin_name,
Expand Down Expand Up @@ -499,7 +500,7 @@ def get_packages(self, plugin_name: str, plugin_version: str, biz_version: str =
packages = models.Packages.objects.filter(id__in=package_ids)
if biz_version:
packages = packages.filter(
id__in=[pkg["id"] for pkg in packages if version.Version(pkg.version) <= version.Version(biz_version)]
id__in=[pkg.id for pkg in packages if version.Version(pkg.version) <= version.Version(biz_version)]
)
return packages

Expand Down

0 comments on commit dd717e3

Please sign in to comment.