* Preserve webhook namespaceSelector.matchLabels
I have a webhook with this definition and the reconciler is
removing the matchLabels field:
Current resource:
```
namespaceSelector:
matchExpressions:
- key: webhooks.knative.dev/exclude
operator: DoesNotExist
objectSelector:
matchLabels:
app.kubernetes.io/component: kafka-dispatcher
```
Applied resource:
```
namespaceSelector:
matchExpressions: [ ]
matchLabels:
app.kubernetes.io/name: knative-eventing
objectSelector:
matchLabels:
app.kubernetes.io/component: kafka-dispatcher
```
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* Optimize cases that don't need ensureLabelSelectorRequirements
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* Add smart handling of selectors in webhooks
This is an alternative fix for #1590. Instead of arbitrarily adding a label from a different project to avoid the reconcilers racing, this adds "smart" handling of the selectors in that labels not inside the knative.dev domain are plainly ignored and our own selectors are added additively.
* Fix formatting
* Fix missing variable usage