pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Multiple defaulting webhooks don't work

Open pierDipi opened this issue 3 years ago • 8 comments
trafficstars

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

  1. Create defaulting webhook w1
  2. Create an Admission controller for w1 in the main
  3. Create defaulting webhook w2
  4. Create an Admission controller for w2 in the main
  5. Observer that rules are applied for on only 1 of them

Additional Info

/area API /kind bug

pierDipi avatar Feb 02 '22 17:02 pierDipi

What's the use case here? Since you effectively control the component why not create a single admission controller with all the relevant types?

dprotaso avatar Feb 03 '22 15:02 dprotaso

that doesn't work because I need to define my own object selectors for only a subset of types.

pierDipi avatar Feb 03 '22 18:02 pierDipi

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.

pierDipi avatar Feb 03 '22 18:02 pierDipi

@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

pierDipi avatar Feb 04 '22 09:02 pierDipi

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.

github-actions[bot] avatar May 06 '22 01:05 github-actions[bot]

/remove-lifecycle stale

pierDipi avatar May 06 '22 07:05 pierDipi

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.

github-actions[bot] avatar Aug 05 '22 01:08 github-actions[bot]

/remove-lifecycle stale

pierDipi avatar Sep 06 '22 08:09 pierDipi

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.

github-actions[bot] avatar Dec 06 '22 01:12 github-actions[bot]

/remove-lifecycle stale

pierDipi avatar Dec 06 '22 07:12 pierDipi

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.

github-actions[bot] avatar Mar 07 '23 01:03 github-actions[bot]

/remove-lifecycle stale

pierDipi avatar Mar 07 '23 09:03 pierDipi

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.

github-actions[bot] avatar Jun 06 '23 01:06 github-actions[bot]

Fixed by https://github.com/knative/pkg/pull/2738

pierDipi avatar Jun 12 '23 15:06 pierDipi