Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Pass command-line arguments #193

Merged
merged 4 commits into from
Jan 21, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/controller/cmd/root.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ func init() {
rootCmd.AddCommand(viper.GetConfigCommand())
}

func initConfig(_ *cobra.Command, _ []string) error {
func initConfig(cmd *cobra.Command, _ []string) error {
configAccessor = viper.NewAccessor(config.Options{
StrictMode: true,
SearchPaths: []string{cfgFile},
})

configAccessor.InitializePflags(cmd.Flags())

err := configAccessor.UpdateConfig(context.TODO())
if err != nil {
return err
Expand Down