Skip to content

Commit

Permalink
version cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Oct 17, 2024
1 parent 79bfe0f commit 1efd984
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
11 changes: 11 additions & 0 deletions kardinal-cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" {
Expand All @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions kardinal-cli/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions kardinal_version/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/kurtosis-tech/kardinal/kardinal_version

go 1.22.5
5 changes: 5 additions & 0 deletions kardinal_version/kardinal_version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package kardinal_version

const (
KardinalVersion = "0.4.3"
)
Empty file added kurtosis_version.txt
Empty file.

0 comments on commit 1efd984

Please sign in to comment.