HydraIssues

hydracluster nodes list should query the API when run from a client
open improvement Project: hydracluster Reporter: 13 Nov 2026 10:53

Description

Split out of #1180, which fixed the defect but not the inconvenience.

#1180 stopped nodes list reporting an empty fleet off-server: it now names the store path it read and says it cannot answer away from the server (commit f085096). That removes the silent wrong answer, which was the bug. It does not make the command useful from a workstation.

What is wanted

When a server config is present, nodes list should query GET /api/v1/nodes instead of reading the local YAML store. The credentials are already there: server.domain and server.admin_token in ~/.hydracluster/config.yaml. Querying that endpoint by hand from a client returns the real fleet (43 nodes at the time of writing) from the same machine where the command reported nothing.

Why it is a separate ticket

It is a different shape of work from the one-branch fix in #1180:

  • a client path and an HTTP error surface that does not exist in this command today,
  • a decision about which mode to use, and whether it is automatic (config present means client) or explicit (a flag), with the server's own invocation still reading its store directly,
  • handling an unreachable or unauthorised server without falling back to the local store, since a silent fallback would recreate exactly the failure #1180 removed.

That last point is the trap. If the API call fails and the command quietly reads the empty local store instead, the original bug comes back wearing a different hat.

Scope note

nodes has five subcommands sharing loadNodesStore: list, approve, deny, remove, provision. The four write commands mutate the server's store directly and are a larger question than this ticket. Doing list alone is a legitimate first slice, but the asymmetry should be deliberate rather than accidental, and worth a line in the help text so nobody assumes approve works from a client because list does.

Status

Unclaimed. Raised during the GitHub org migration work; neither session that found it is taking it.