Skip to content

Commit

Permalink
Make ruletype test token's viper path unique (#4236)
Browse files Browse the repository at this point in the history
This is needed for it to work... as it seems the viper name has clashed
with other subcommands in that binary.

Signed-off-by: Juan Antonio Osorio <[email protected]>
  • Loading branch information
JAORMX committed Aug 22, 2024
1 parent d2210d0 commit d32c80c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/dev/app/rule_type/rttst.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func CmdTest() *cobra.Command {
os.Exit(1)
}

if err := viper.BindPFlag("auth.token", testCmd.Flags().Lookup("token")); err != nil {
if err := viper.BindPFlag("test.auth.token", testCmd.Flags().Lookup("token")); err != nil {
fmt.Fprintf(os.Stderr, "Error binding flag: %s\n", err)
os.Exit(1)
}
Expand All @@ -99,7 +99,7 @@ func testCmdRun(cmd *cobra.Command, _ []string) error {
ppath := cmd.Flag("profile")
rstatus := cmd.Flag("remediate-status")
rMetaPath := cmd.Flag("remediate-metadata")
token := viper.GetString("auth.token")
token := viper.GetString("test.auth.token")
providerclass := cmd.Flag("provider")
providerconfig := cmd.Flag("provider-config")

Expand Down

0 comments on commit d32c80c

Please sign in to comment.