Skip to main content

Module version

Module version 

Source
Expand description

cellctl version — print client version, then attempt the server version.

The client version is printed unconditionally on its own line so an operator always sees what they have locally even when the server is unreachable. After that, we attempt the server query and:

  • on success, print server: cellos-server <ver> (<gitSha> <buildProfile>) and exit 0 — fields the server omits (e.g. gitSha when the build did not capture one) are simply elided from the parenthetical;
  • on transport OR HTTP error, return a CtlError::api so the process exits non-zero. The error formatter prints cellctl: api: unable to connect to the server: <reason> to stderr, matching the SMOKE-TEST wave-2 contract.

This matches kubectl version, which also exits non-zero when it cannot reach the API server. See SMOKE-TEST report Finding #2 (wave 2) and E2E report SRV-001 (wave 3, server route added).

§Wire shape (server side: GET /v1/version)

{ "server": { "version": "0.5.0", "gitSha": "abc1234", "buildProfile": "release" },
  "api":    { "version": "v1" } }

gitSha is optional. We tolerate either the nested shape (added by SRV-001) or a flat legacy shape ({ "version": "..." }) so a cellctl pointed at an older server still prints something useful.

Functions§

run