mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Fixed root persistent flags not binding correctly
This commit is contained in:
parent
809aa91ec6
commit
7285492815
3 changed files with 12 additions and 9 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"github.com/OpenCHAMI/magellan/pkg/crawler"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// The `crawl` command walks a collection of Redfish endpoints to collect
|
||||
|
|
@ -66,5 +67,9 @@ func init() {
|
|||
crawlCmd.Flags().StringP("password", "p", "", "Set the password for the BMC")
|
||||
crawlCmd.Flags().BoolP("insecure", "i", false, "Ignore SSL errors")
|
||||
|
||||
viper.BindPFlag("crawl.username", crawlCmd.Flags().Lookup("username"))
|
||||
viper.BindPFlag("crawl.password", crawlCmd.Flags().Lookup("password"))
|
||||
viper.BindPFlag("crawl.insecure", crawlCmd.Flags().Lookup("insecure"))
|
||||
|
||||
rootCmd.AddCommand(crawlCmd)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue