command "pmm-admin inventory" returns GO errors

Description

Easy to reproduce

Before:

 

After:

 

Implementation:

The top-level `pmm-admin inventory` is a "hidden" command, which was done on purpose so that user favor as shorter and therefore the more memorable  `pmm-admin add/remove service` commands. However, `pmm-admin inventory list/add/remove` were also hidden, which was contributing to the reported problem, since Kong was unable to execute the `pmm-admin inventory [--help]` command. 

The solution was to implement the inventory's `RunCmd()` method and "unhide" `pmm-admin inventory list/add/remove` comands, while keeping `pmm-admin inventory` hidden.

How to test

1/ Deploy a docker-based PMM Server

2/ get inside the container with `docker exec -it pmm-server bash`

3/ run `pmm-admin inventory` - you should see a helpful output and not the error trace 

Note: running `pmm-admin inventory --help` yields the same effect

How to document

-

Activity

Show:

vasyl.yurkovych August 24, 2023 at 9:26 AM

verified in build: 
server docker - perconalab/pmm-server-fb:PR-3358-01eea2a
client docker - perconalab/pmm-client-fb:PR-3358-01eea2a
client - https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-3358-01eea2a.tar.gz

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Needs Doc

No

Planned Version/s

Fix versions

Story Points

Affects versions

Smart Checklist

Created July 26, 2023 at 1:45 PM
Updated March 5, 2024 at 10:15 PM
Resolved August 24, 2023 at 10:13 AM