Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [pt1.] version cmd #281

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
tedim52 marked this conversation as resolved.
Show resolved Hide resolved
)
Empty file added kurtosis_version.txt
Empty file.
Loading