Skip to content

Commit

Permalink
Merge pull request kcp-dev#3135 from embik/set-kubectl-workspace-version
Browse files Browse the repository at this point in the history
✨ Add version to kubectl-workspace
  • Loading branch information
kcp-ci-bot authored May 20, 2024
2 parents d8daae8 + 4efebf7 commit 62229c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli/pkg/workspace/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/spf13/pflag"

"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/component-base/version"

"github.com/kcp-dev/kcp/cli/pkg/workspace/plugin"
)
Expand Down Expand Up @@ -101,6 +102,12 @@ func New(streams genericclioptions.IOStreams) (*cobra.Command, error) {
}
cmdOpts.BindFlags(cmd)

if v := version.Get().String(); len(v) == 0 {
cmd.Version = "<unknown>"
} else {
cmd.Version = v
}

useWorkspaceOpts := plugin.NewUseWorkspaceOptions(streams)
useCmd := &cobra.Command{
Aliases: []string{"cd"},
Expand Down

0 comments on commit 62229c4

Please sign in to comment.