Open balpert89 opened 3 years ago
Hello @balpert89,
Thanks for using OLM and for submitting this issue.
As described in the OLM Webhook Docs, webhooks shipped with operators are scoped to the TargetNamespaces defined by the OperatorGroup. I suspect that you are creating the Operator in an OperatorGroup that is scoped to a set of namespaces.
If you wish for your webhook to intercept pod create commands in all namespaces you will need to install the operator in an AllNamespace OperatorGroup.
If you are already using an AllNAmespace OperatorGroup, please share the steps to reproduce the error.
Configuration
How to scope MutatingWebhookConfiguration to another namespace?
What did you do? I have created a MutatingWebhook with the operator-sdk CLI, deployed it manually which works. Deploying the operator including the webhook with OLM injects a namespaceSelector to the resulting
MutatingWebhookConfiguration
.What did you expect to see? This is not a bug, but I cannot find the location that I have to change so the Webhook can be used in all namespaces, not only in the operator namespace.
What did you see instead? Under which circumstances? The webhook is only triggered when I changes are done in the same namespace like the operator.
Environment
operator-lifecycle-manager version: 0.16.1
Kubernetes version information: Openshift 4.6.4 Openshift 4.5.21 (olm 0.15.1)
Additional context
MutatingWebhookConfiguration
I want to have the following to appear in
webhooks.namespaceSelector
:Excerpt of
ClusterServiceVersion