Skip to content

Commit

Permalink
add check var
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuanyiyi committed Oct 8, 2023
1 parent 6868bd0 commit f8e1705
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func main() {
flag.StringVar(&scaleServerAddr, "scale-server-bind-address", ":6000", "The address the scale server endpoint binds to.")
viper.SetDefault(apiServerSustainedQPSFlag, 20)
viper.SetDefault(apiServerBurstQPSFlag, 30)
viper.BindEnv(apiServerSustainedQPSFlag)
viper.BindEnv(apiServerBurstQPSFlag)
Must(viper.BindEnv(apiServerSustainedQPSFlag))
Must(viper.BindEnv(apiServerBurstQPSFlag))

// Add cloud provider flags
cloudprovider.InitCloudProviderFlags()
Expand Down Expand Up @@ -215,3 +215,10 @@ func main() {
os.Exit(1)
}
}

// Must panics if there is an error
func Must(err error) {
if err != nil {
setupLog.Error(err, "viper.BindEnv error")
}
}
1 change: 0 additions & 1 deletion pkg/util/runtime.go

This file was deleted.

0 comments on commit f8e1705

Please sign in to comment.