Skip to content

Commit

Permalink
feat: 提供 Agent 包管理后台基础接口 (closed #1683)
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 22810
  • Loading branch information
ping15 committed Nov 5, 2024
1 parent a90177c commit 39407c2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/backend/subscription/steps/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,18 @@ def make_instances_migrate_actions(self, instances, auto_trigger=False, preview_
# Agent2 走自更新,仍需调整
backend_const.ActionNameType.UPGRADE_PROXY: backend_const.ActionNameType.UPGRADE_PROXY,
}
version_map: Dict[int, str] = {
version_map["bk_host_id"]: version_map["version"]
for version_map in self.subscription_step.config.get("version_map_list", [])
}
for instance_id, instance in instances.items():
if instance["meta"]["GSE_VERSION"] == GseVersion.V1.value:
instance_actions[instance_id] = self.subscription_step.config["job_type"]
continue
instance_actions[instance_id] = job_type_map[self.subscription_step.config["job_type"]]

if instance_actions[instance_id] == backend_const.ActionNameType.UPGRADE_AGENT:
version_map: Dict[int, str] = {
version_map["bk_host_id"]: version_map["version"]
for version_map in self.subscription_step.config.get("version_map_list", [])
}

bk_host_id: int = instance["host"]["bk_host_id"]
agent_version: str = models.ProcessStatus.objects.get(
bk_host_id=bk_host_id, name=models.ProcessStatus.GSE_AGENT_PROCESS_NAME
Expand Down

0 comments on commit 39407c2

Please sign in to comment.