In createWebhooks, InjectDecoder
and InjectClient
are currently being called manually. This is because the mechanism for automatic injection was removed in this pull request.
According to the example in controller-runtime, using WebhookManagedBy
allows for a more intuitive setup.
builder.WebhookManagedBy(mgr).
For(&corev1.Pod{}).
WithDefaulter(&podAnnotator{}).
WithValidator(&podValidator{}).
Complete()