pkg
pkg copied to clipboard
Multiple defaulting webhooks don't work
Actual Behavior
Creating 2 defaulting webhooks w1 and w2 inside the same pod
for 2 different mutating webhook configuration manifests
doesn't work since the lease name is based on the hardcoded
queue name DefaultingWebhook.
const queueName = "DefaultingWebhook"
c := controller.NewContext(ctx, wh, controller.ControllerOptions{WorkQueueName: queueName, Logger: logger.Named(queueName)})
so, we get a pod competing for the same lease in 2 separate reconcilers for 2 separate webhooks.
Expected Behavior
Allow having multiple defaulting webhooks served by the same pod.
Steps to Reproduce the Problem
- Create defaulting webhook
w1 - Create an Admission controller for
w1in the main - Create defaulting webhook
w2 - Create an Admission controller for
w2in the main - Observer that rules are applied for on only 1 of them
Additional Info
/area API /kind bug
What's the use case here? Since you effectively control the component why not create a single admission controller with all the relevant types?
that doesn't work because I need to define my own object selectors for only a subset of types.
The use case is to have a webhook that responds on some types within a namespace with a specific label and another one that responds on some types in any namespace.
@dprotaso the only problem is the hardcoded const queueName = "...", I can go with overriding only the queue name without
overriding the whole ControllerOptions as in https://github.com/knative/pkg/pull/2420
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/remove-lifecycle stale
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/remove-lifecycle stale
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/remove-lifecycle stale
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/remove-lifecycle stale
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
Fixed by https://github.com/knative/pkg/pull/2738