Fix panic on startup when misconfigured (#154)

Fixes #153
This commit is contained in:
Yusuke Kuoka
2020-11-10 17:03:33 +09:00
committed by GitHub
parent f2a2ab7ede
commit 3f335ca628
2 changed files with 5 additions and 7 deletions

View File

@@ -82,15 +82,17 @@ func main() {
flag.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, "Determines the minimum frequency at which K8s resources managed by this controller are reconciled. When you use autoscaling, set to a lower value like 10 minute, because this corresponds to the minimum time to react on demand change")
flag.Parse()
logger := zap.New(func(o *zap.Options) {
o.Development = true
})
ghClient, err = c.NewClient()
if err != nil {
fmt.Fprintln(os.Stderr, "Error: Client creation failed.", err)
os.Exit(1)
}
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
}))
ctrl.SetLogger(logger)
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,