From 1efd984ed0f50a3ec1083c374a277445e95c5710 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Thu, 17 Oct 2024 23:06:36 +0900 Subject: [PATCH] version cmd --- kardinal-cli/cmd/root.go | 11 +++++++++++ kardinal-cli/go.mod | 10 ++++++---- kardinal_version/go.mod | 3 +++ kardinal_version/kardinal_version.go | 5 +++++ kurtosis_version.txt | 0 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 kardinal_version/go.mod create mode 100644 kardinal_version/kardinal_version.go create mode 100644 kurtosis_version.txt diff --git a/kardinal-cli/cmd/root.go b/kardinal-cli/cmd/root.go index df524706..ea5ac22c 100644 --- a/kardinal-cli/cmd/root.go +++ b/kardinal-cli/cmd/root.go @@ -32,6 +32,7 @@ import ( "kardinal.cli/kontrol" "kardinal.cli/tenant" + "github.com/kurtosis-tech/kardinal/kardinal_version" api "github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api/api/golang/client" api_types "github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api/api/golang/types" appv1 "k8s.io/api/apps/v1" @@ -622,6 +623,15 @@ var tenantShowCmd = &cobra.Command{ }, } +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Show version of Kardinal CLI running", + Args: cobra.ExactArgs(0), + Run: func(cmd *cobra.Command, args []string) { + fmt.Printf("%s\n", kardinal_version.KardinalVersion) + }, +} + func init() { devMode = false if os.Getenv("KARDINAL_CLI_DEV_MODE") == "TRUE" { @@ -637,6 +647,7 @@ func init() { rootCmd.AddCommand(reportInstall) rootCmd.AddCommand(topologyCmd) rootCmd.AddCommand(tenantCmd) + rootCmd.AddCommand(versionCmd) flowCmd.AddCommand(listCmd, createCmd, deleteCmd, telepresenceInterceptCmd) managerCmd.AddCommand(deployManagerCmd, removeManagerCmd) diff --git a/kardinal-cli/go.mod b/kardinal-cli/go.mod index 23021808..110685af 100644 --- a/kardinal-cli/go.mod +++ b/kardinal-cli/go.mod @@ -1,14 +1,16 @@ module kardinal.cli -go 1.22.0 +go 1.22.3 -toolchain go1.22.3 - -replace github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api => ../libs/cli-kontrol-api +replace ( + github.com/kurtosis-tech/kardinal/kardinal_version => ../kardinal_version + github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api => ../libs/cli-kontrol-api +) require ( github.com/adrg/xdg v0.4.0 github.com/google/uuid v1.6.0 + github.com/kurtosis-tech/kardinal/kardinal_version v0.0.0-00010101000000-000000000000 github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 github.com/samber/lo v1.46.0 github.com/segmentio/analytics-go/v3 v3.3.0 diff --git a/kardinal_version/go.mod b/kardinal_version/go.mod new file mode 100644 index 00000000..96f6799b --- /dev/null +++ b/kardinal_version/go.mod @@ -0,0 +1,3 @@ +module github.com/kurtosis-tech/kardinal/kardinal_version + +go 1.22.5 diff --git a/kardinal_version/kardinal_version.go b/kardinal_version/kardinal_version.go new file mode 100644 index 00000000..2dcf6cb0 --- /dev/null +++ b/kardinal_version/kardinal_version.go @@ -0,0 +1,5 @@ +package kardinal_version + +const ( + KardinalVersion = "0.4.3" +) diff --git a/kurtosis_version.txt b/kurtosis_version.txt new file mode 100644 index 00000000..e69de29b