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 11, 2023
1 parent 1d1c15a commit 508fa8f
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 508fa8f

Please sign in to comment.