Skip to content

Commit

Permalink
PMM-13392 Strip agent status prefix in pmm-admin status cmd (#3229)
Browse files Browse the repository at this point in the history
* 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`
  • Loading branch information
ademidoff authored Oct 9, 2024
1 parent e20ac7c commit eb12a93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions admin/commands/inventory/list_agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func getAgentStatus(status *string) string {
if res == "" {
res = "UNKNOWN"
}
res, _ = strings.CutPrefix(res, "AGENT_STATUS_")
return res
}

Expand Down
3 changes: 2 additions & 1 deletion admin/commands/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down

0 comments on commit eb12a93

Please sign in to comment.