Skip to content

Register webhooks by using sigs.k8s.io/controller-runtime/pkg/builder.WebhookManagedBy #20

@ryotarai

Description

@ryotarai

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions