Skip to content

Commit

Permalink
Minor cleanup of the webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Gerdesmeier committed Jan 10, 2019
1 parent 114ee46 commit f232b3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ func main() {
}
logger, atomicLevel := logging.NewLoggerFromConfig(config, component)
defer logger.Sync()
logger = logger.With(zap.String(logkey.ControllerType, "webhook"))
logger = logger.With(zap.String(logkey.ControllerType, component))

logger.Info("Starting the Configuration Webhook")

// set up signals so we handle the first shutdown signal gracefully
// Set up signals so we handle the first shutdown signal gracefully.
stopCh := signals.SetupSignalHandler()

clusterConfig, err := clientcmd.BuildConfigFromFlags(*masterURL, *kubeconfig)
Expand All @@ -79,7 +79,7 @@ func main() {
configMapWatcher := configmap.NewInformedWatcher(kubeClient, system.Namespace)
configMapWatcher.Watch(logging.ConfigName, logging.UpdateLevelFromConfigMap(logger, atomicLevel, component))
if err = configMapWatcher.Start(stopCh); err != nil {
logger.Fatalf("failed to start configuration manager: %v", err)
logger.Fatal("Failed to start the ConfigMap watcher", zap.Error(err))
}

options := webhook.ControllerOptions{
Expand All @@ -103,8 +103,8 @@ func main() {
},
Logger: logger,
}
err = controller.Run(stopCh)
if err != nil {
logger.Fatal("Failed to create the admission controller", zap.Error(err))
logger.Fatal("Failed to start the admission controller", zap.Error(err))
}
controller.Run(stopCh)
}

0 comments on commit f232b3e

Please sign in to comment.