Skip to content

Commit

Permalink
feat: 安装插件判断tag版本与业务设定最大版本(closed #2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpyoung3 committed Nov 4, 2024
1 parent 698668e commit e6fe077
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/backend/components/collections/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,15 @@ def _execute(self, data, parent_data, common_data: PluginCommonData):
)
# 如果版本号匹配到标签名称,取对应标签下的真实版本号
version_str = getattr(package, "version", "")
golbal_version_config = models.GlobalSettings.get_config(
if version_str in tag_name__obj_map:
version_str = tag_name__obj_map[package.version].target_version

global_version_config = models.GlobalSettings.get_config(
models.GlobalSettings.KeyEnum.PLUGIN_VERSION_CONFIG.value
)
biz_version = None
if version_str in tag_name__obj_map:
version_str = tag_name__obj_map[package.version].target_version
if bk_biz_id in golbal_version_config:
biz_version_config = golbal_version_config[bk_biz_id]
if bk_biz_id in global_version_config:
biz_version_config = global_version_config[bk_biz_id]
for plugin_name, plugin_version in biz_version_config.items():
if plugin_name == package.project:
biz_version = plugin_version
Expand Down

0 comments on commit e6fe077

Please sign in to comment.