diff --git a/apps/backend/components/collections/agent_new/push_files_to_proxy.py b/apps/backend/components/collections/agent_new/push_files_to_proxy.py index d36115dda..674610b71 100644 --- a/apps/backend/components/collections/agent_new/push_files_to_proxy.py +++ b/apps/backend/components/collections/agent_new/push_files_to_proxy.py @@ -22,6 +22,15 @@ class PushFilesToProxyService(AgentTransferFileService): def get_file_list(self, data, common_data: AgentCommonData, host: models.Host) -> List[str]: file_list = data.get_one_of_inputs("file_list", default=[]) + exclude_map = { + constants.CpuType.x86_64: ("aarch64.tgz",), + constants.CpuType.aarch64: ("x86_64.tgz",), + } + # 获取当前架构对应的排除后缀 + exclude_suffix = exclude_map.get(host.cpu_arch, tuple()) + # 如果存在排除后缀,则进行过滤 + if exclude_suffix: + file_list = [item for item in file_list if not item.endswith(exclude_suffix)] from_type = data.get_one_of_inputs("from_type") host_ap: Optional[models.AccessPoint] = self.get_host_ap(common_data, host) if not host_ap: