Skip to content

fix(cli): show the host address and state in get hosts - #58

Merged
TheMeinerLP merged 1 commit into
mainfrom
fix/cli-hosts-address
Nov 25, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
fix/cli-hosts-address

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Problem

Running `grus get hosts` against a real controller printed the hosts with an empty ADDRESSES column, and the memory column was empty too. An operator looking for where a host can be reached saw nothing, even though the controller knew the address and the port range.

Approach

The CLI was looking for a field the controller never sends. It now reads the address and port range the agent reports and shows whether the host is online and how many instances it runs. The table is NAME, VERSION, ADDRESS, PORTS, ONLINE, INSTANCES and LAST-SEEN.

The memory column is gone from the table. Agents that do not report their capacity left it empty for every host, so it added nothing. The full data stays available with `-o json` and `-o yaml`.

Testing

A CLI test feeds the command the host shape the controller really returns and checks the header and the row. It failed before the change and passes after it. The client and CLI packages pass, and build, vet and gofmt are clean.

The hosts table read an "addresses" field the controller never sends,
so the ADDRESSES column was always empty. The table now reads the
single "address" field and shows the port range, online state and the
number of instances the agent reported. The memory column is dropped:
agents that do not report capacity left it empty, and it stays visible
in -o json and -o yaml.
@TheMeinerLP TheMeinerLP changed the title fix(cli): show the host address and capacity in get hosts fix(cli): show the host address and state in get hosts Nov 25, 2026
@TheMeinerLP
TheMeinerLP merged commit 0e9433b into main Nov 25, 2026
8 checks passed
@TheMeinerLP
TheMeinerLP deleted the fix/cli-hosts-address branch November 25, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant