From 5548651615716492c9663f63dc4163951c98aa56 Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Wed, 3 Dec 2025 12:48:00 +0800 Subject: [PATCH] fix: Correctly trim parentheses from detected Linux distribution name in GetDistro method --- agent/utils/psutil/host.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/utils/psutil/host.go b/agent/utils/psutil/host.go index 5dd5feac2..fa4ebeeef 100644 --- a/agent/utils/psutil/host.go +++ b/agent/utils/psutil/host.go @@ -43,8 +43,8 @@ func (h *HostInfoState) GetHostInfo(forceRefresh bool) (*host.InfoStat, error) { func (h *HostInfoState) GetDistro() string { if h.cachedDistro == "" { d := detectLinuxDistro() - if strings.HasSuffix(d, "(") { - d = d[:strings.Index(d, "(")] + if strings.Contains(d, "(") && strings.Contains(d, ")") { + d = d[:strings.LastIndex(d, "(")] } h.cachedDistro = strings.TrimSpace(d) }