Skip to content

Commit

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

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
  • Loading branch information
Jack-R-lantern committed Jul 2, 2023
1 parent c5c2015 commit 2b2a31f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/tetra/tracingpolicy/tracingpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import (
"github.com/spf13/viper"
)

var (
matchBinary string
)

func New() *cobra.Command {
tpCmd := &cobra.Command{
Use: "tracingpolicy",
Expand Down Expand Up @@ -75,8 +79,8 @@ func New() *cobra.Command {
}

flags := tpGenerateCmd.Flags()
flags.String("match-binary", "", "Add binary to matchBinaries selector")
viper.BindPFlags(flags)

flags.StringVar(&matchBinary, "match-binary", "", "Add binary to matchBinaries selector")

tpCmd.AddCommand(tpAddCmd, tpListCmd, tpGenerateCmd)
return tpCmd
Expand Down

0 comments on commit 2b2a31f

Please sign in to comment.