Skip to content

Commit

Permalink
feat: [pt1.] version cmd (#281)
Browse files Browse the repository at this point in the history
This is a duplicate of the version cmd but part 1 - it adds the
`kardinal_version` module but does not hook it up to the build process
yet.
  • Loading branch information
tedim52 authored Oct 17, 2024
1 parent 79bfe0f commit 563e0a3
Show file tree
Hide file tree
Showing 7 changed files with 629 additions and 12 deletions.
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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: 7 additions & 3 deletions kardinal-cli/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
module kardinal.cli

go 1.22.0
go 1.22.5

toolchain go1.22.3
toolchain go1.22.6

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
Loading

0 comments on commit 563e0a3

Please sign in to comment.