Skip to content

Commit

Permalink
Update the version subcommmand of rdctl to retrieve the version from git
Browse files Browse the repository at this point in the history
Closes rancher-sandbox#5808

Signed-off-by: Carlos Barcenilla <[email protected]>
  • Loading branch information
bcxpro committed Feb 24, 2025
1 parent 2865f1a commit 8cd7649
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/go/rdctl/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"

"github.com/rancher-sandbox/rancher-desktop/src/go/rdctl/pkg/client"
"github.com/rancher-sandbox/rancher-desktop/src/go/rdctl/pkg/version"
"github.com/spf13/cobra"
)

Expand All @@ -29,7 +30,7 @@ var showVersionCmd = &cobra.Command{
Short: "Shows the CLI version.",
Long: `Shows the CLI version.`,
RunE: func(cmd *cobra.Command, args []string) error {
_, err := fmt.Printf("rdctl client version: %s, targeting server version: %s\n", client.Version, client.ApiVersion)
_, err := fmt.Printf("rdctl client version: %s, targeting server version: %s\n", version.Version, client.ApiVersion)
return err
},
}
Expand Down
1 change: 0 additions & 1 deletion src/go/rdctl/pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
)

const (
Version = "1.1.0"
ApiVersion = "v1"
)

Expand Down
3 changes: 3 additions & 0 deletions src/go/rdctl/pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package version

var Version = "0.0.0"

0 comments on commit 8cd7649

Please sign in to comment.