You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(version): print out version regardless of port-forwarding; pass through contexts (#980)
This PR prints out the `kagent` version even if a port-forwarding to the
`kagent` server fails. In case the port-forwarding does not succeed, the
unavailable versions will be marked as `<unknown>`:
Fixes: #868
Related to: #879
```sh
> go run cli/cmd/kagent/main.go version
Error starting port-forward: failed to establish connection to kagent-controller. error connecting to server. Please run 'install' command first
{"backend_version":"unknown","build_date":"unknown","git_commit":"none","kagent_version":"dev"}
```
~~**Note:** We might can consider removing the error message as it
breaks the `json` output ...~~
Furthermore:
- This PR uses `cmd.Context()` consistently throughout all `kagent`
subcommands.
- It adds a `help` Makefile target for a neat list of available Makefile
targets
```sh
> make
controller-gen Download controller-gen locally if necessary.
envtest Download setup-envtest locally if necessary.
fmt Run go fmt against code.
generate Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
golangci-lint Download golangci-lint locally if necessary.
help list makefile targets
lint-config Verify golangci-lint linter configuration
lint-fix Run golangci-lint linter and perform fixes
lint Run golangci-lint linter
manifests Generate ClusterRole and CustomResourceDefinition objects.
run Run a controller from your host.
setup-envtest Download the binaries required for ENVTEST in the local bin directory.
vet Run go vet against code.
```
Signed-off-by: Tom Morelly <[email protected]>
0 commit comments