From eb12a93bb3672e7f852c4c7991567e839d0e34dc Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Wed, 9 Oct 2024 19:51:18 +0300 Subject: [PATCH] PMM-13392 Strip agent status prefix in `pmm-admin status` cmd (#3229) * PMM-13392 Strip agent status prefix in `pmm-admin status` * PMM-13392 trigger the workflow run * PMM-13392 Strip agent status prefix in `pmm-admin inventory list agents` --- admin/commands/inventory/list_agents.go | 1 + admin/commands/status.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/commands/inventory/list_agents.go b/admin/commands/inventory/list_agents.go index c0de4919f4..e0886c22f8 100644 --- a/admin/commands/inventory/list_agents.go +++ b/admin/commands/inventory/list_agents.go @@ -90,6 +90,7 @@ func getAgentStatus(status *string) string { if res == "" { res = "UNKNOWN" } + res, _ = strings.CutPrefix(res, "AGENT_STATUS_") return res } diff --git a/admin/commands/status.go b/admin/commands/status.go index 9d8e677922..119e1cba5b 100644 --- a/admin/commands/status.go +++ b/admin/commands/status.go @@ -60,7 +60,8 @@ func (res *statusResult) HumanReadableAgentType(agentType string) string { } func (res *statusResult) NiceAgentStatus(status string) string { - return cases.Title(language.English).String(strings.ToLower(status)) + s, _ := strings.CutPrefix(status, "AGENT_STATUS_") + return cases.Title(language.English).String(strings.ToLower(s)) } func (res *statusResult) Result() {}