Skip to content

Commit

Permalink
hubble: consistenly prefix version string with 'v'
Browse files Browse the repository at this point in the history
[ upstream commit b424bfd ]

Prior to this change, using `hubble --version` and `hubble version`
would produce different results:

    hubble --version # v1.16.3
    hubble version   # 1.16.3

Ref: cilium/hubble#1613

Signed-off-by: Robin Hahling <[email protected]>
Signed-off-by: Nicolas Busseneau <[email protected]>
  • Loading branch information
rolinh authored and nbusseneau committed Dec 1, 2024
1 parent 90a4f28 commit 55e82b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hubble/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ hubble:
$(MAKE) -C $(SUBDIRS_HUBBLE_CLI) hubble-bin

hubble-bin:
GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO_BUILD) $(if $(GO_TAGS),-tags $(GO_TAGS)) -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=${GIT_BRANCH}' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=$(GIT_HASH)' -X 'github.com/cilium/cilium/hubble/pkg.Version=${VERSION}'" -o $(TARGET) $(SUBDIRS_HUBBLE_CLI)
GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO_BUILD) $(if $(GO_TAGS),-tags $(GO_TAGS)) -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=${GIT_BRANCH}' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=$(GIT_HASH)' -X 'github.com/cilium/cilium/hubble/pkg.Version=v${VERSION}'" -o $(TARGET) $(SUBDIRS_HUBBLE_CLI)

release:
cd ../ && \
Expand Down
2 changes: 1 addition & 1 deletion hubble/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func NewWithViper(vp *viper.Viper) *cobra.Command {
rootCmd.SetUsageTemplate(template.Usage)

rootCmd.SetErr(os.Stderr)
rootCmd.SetVersionTemplate("{{with .Name}}{{printf \"%s \" .}}{{end}}{{printf \"v%s\" .Version}}\r\n")
rootCmd.SetVersionTemplate("{{with .Name}}{{printf \"%s \" .}}{{end}}{{printf \"%s\" .Version}}\r\n")

rootCmd.AddCommand(
cmdConfig.New(vp),
Expand Down

0 comments on commit 55e82b8

Please sign in to comment.