-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add
--client
flag to kargo version
This adds support for supplying a `--client` flag to `kargo version`, which avoids the command from attempting to collect version information from the API server. ```console $ kargo version --client Client Version: devel+unknown.dirty ``` In addition, the order of collecting information has been adjusted to allow partial information to be printed when the API server can not be reached before returning an error. ```console $ kargo version Client Version: devel+unknown.dirty Error: get version info from server: unavailable: dial tcp [::1]:30081: connect: connection refused $ kargo version --output yaml apiVersion: kargo.akuity.io/v1alpha1 cli: buildTime: "2024-02-22T11:18:51Z" compiler: gc gitTreeDirty: true goVersion: go1.21.3 platform: linux/amd64 version: devel+unknown.dirty kind: ComponentVersions Error: get version info from server: unavailable: dial tcp [::1]:30081: connect: connection refused ``` However, in case `--output` is provided and the printer itself runs into an issue, this error takes precedence. ```console $ kargo version --output go-template --template '{{ .cli.version }' Error: new printer: error parsing template {{ .cli.version }, template: output:1: unexpected "}" in operand ``` Signed-off-by: Hidde Beydals <hidde@hhh.computer>
- Loading branch information
Showing
3 changed files
with
45 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters