Skip to content

Commit

Permalink
fix: cmd/tetra/version remove viper.BindPFlags
Browse files Browse the repository at this point in the history
viper.BindPFlags has a ISSUE spf13/viper#233
replace all viper.BindPFlags

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
  • Loading branch information
Jack-R-lantern committed Jul 2, 2023
1 parent 7396f63 commit c5c2015
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/tetra/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import (
"github.com/cilium/tetragon/pkg/version"

"github.com/spf13/cobra"
"github.com/spf13/viper"
)

var (
client bool
)

func printClientersion() {
Expand All @@ -46,7 +49,7 @@ func New() *cobra.Command {
Short: "Print version",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
if viper.GetBool("client") {
if client {
printClientersion()
return
}
Expand All @@ -62,7 +65,7 @@ func New() *cobra.Command {
},
}
flags := cmd.Flags()
flags.Bool("client", false, "Only print client version without attempting to connect to server")
viper.BindPFlags(flags)
flags.BoolVar(&client, "client", false, "Only print client version without attempting to connect to server")

return cmd
}

0 comments on commit c5c2015

Please sign in to comment.