From 6ac951e39ddf348ae8206587a27b172774edf28e Mon Sep 17 00:00:00 2001 From: crayon <873217631@qq.com> Date: Fri, 27 May 2022 12:26:56 +0800 Subject: [PATCH] =?UTF-8?q?sprintfix:=20=E6=8F=92=E4=BB=B6=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E6=93=8D=E4=BD=9C=E6=9F=A5=E8=AF=A2=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=20(#780)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/backend/components/collections/plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/backend/components/collections/plugin.py b/apps/backend/components/collections/plugin.py index bb9b94a69..c814910e7 100644 --- a/apps/backend/components/collections/plugin.py +++ b/apps/backend/components/collections/plugin.py @@ -1144,10 +1144,6 @@ def _execute(self, data, parent_data, common_data: PluginCommonData): gse_op_params = { "meta": {"namespace": constants.GSE_NAMESPACE, "name": meta_name}, "op_type": op_type, - # GSE 1.0 目标对象 - "hosts": [{"ip": host.inner_ip, "bk_cloud_id": host.bk_cloud_id}], - # GSE 2.0 目标对象 - "agent_id_list": [host.bk_agent_id], # 此字段是节点管理自用,仅用于标识,不会被GSE使用 "nodeman_spec": { "process_status_id": process_status.id, @@ -1171,6 +1167,10 @@ def _execute(self, data, parent_data, common_data: PluginCommonData): }, }, } + if settings.GSE_VERSION == "V1": + gse_op_params["hosts"] = [{"ip": host.inner_ip, "bk_cloud_id": host.bk_cloud_id}] + else: + gse_op_params["agent_id_list"] = [host.bk_agent_id] self.log_info(subscription_instance.id, json.dumps(gse_op_params, indent=2)) proc_operate_req.append(gse_op_params)