Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 7 additions & 1 deletion cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ func main() {
configMapWatcher.Watch(channeldefaulter.ConfigMapName, channelDefaulter.UpdateConfigMap)

if err = configMapWatcher.Start(stopCh); err != nil {
logger.Fatalf("failed to start webhook configmap watcher: %v", err)
logger.Fatalf("failed to start webhook configmap watcher: %v", zap.Error(err))
}

stats, err := webhook.NewStatsReporter()
if err != nil {
logger.Fatalw("failed to initialize the stats reporter", zap.Error(err))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

silly but I think it would be great to capitalize failed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it turns into an error and errors should be lowercase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to know!

}

options := webhook.ControllerOptions{
Expand All @@ -89,6 +94,7 @@ func main() {
Port: 8443,
SecretName: "eventing-webhook-certs",
WebhookName: "webhook.eventing.knative.dev",
StatsReporter: stats,
}
controller := webhook.AdmissionController{
Client: kubeClient,
Expand Down
7 changes: 7 additions & 0 deletions contrib/kafka/cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,24 @@ func main() {

configMapWatcher.Watch(logconfig.ConfigMapName(), logging.UpdateLevelFromConfigMap(logger, atomicLevel, logconfig.WebhookName()))

stats, err := webhook.NewStatsReporter()
if err != nil {
logger.Fatalw("failed to initialize the stats reporter", zap.Error(err))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same about capitalizing failed

}

options := webhook.ControllerOptions{
ServiceName: logconfig.WebhookName(),
DeploymentName: logconfig.WebhookName(),
Namespace: system.Namespace(),
Port: 8443,
SecretName: "messaging-webhook-certs",
WebhookName: "webhook.messaging.knative.dev",
StatsReporter: stats,
}
controller := webhook.AdmissionController{
Client: kubeClient,
Options: options,

Handlers: map[schema.GroupVersionKind]webhook.GenericCRD{
// For group messaging.knative.dev
messagingv1alpha1.SchemeGroupVersion.WithKind("KafkaChannel"): &messagingv1alpha1.KafkaChannel{},
Expand Down