diff --git a/main.go b/main.go index 54dec624..659fce66 100644 --- a/main.go +++ b/main.go @@ -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() @@ -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") + } +} diff --git a/pkg/util/runtime.go b/pkg/util/runtime.go deleted file mode 100644 index c7d86821..00000000 --- a/pkg/util/runtime.go +++ /dev/null @@ -1 +0,0 @@ -package util