mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix: webhooks reconciliation when no policies (#11230)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
e3b51e16a9
commit
bfb00cffc8
1 changed files with 2 additions and 2 deletions
|
@ -870,7 +870,7 @@ func (c *controller) buildResourceMutatingWebhookConfiguration(ctx context.Conte
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *controller) buildResourceMutatingWebhookRules(caBundle []byte, webhookCfg config.WebhookConfig, sideEffects *admissionregistrationv1.SideEffectClass, webhooks []*webhook, mapResourceToOpnType map[string][]admissionregistrationv1.OperationType) []admissionregistrationv1.MutatingWebhook {
|
func (c *controller) buildResourceMutatingWebhookRules(caBundle []byte, webhookCfg config.WebhookConfig, sideEffects *admissionregistrationv1.SideEffectClass, webhooks []*webhook, mapResourceToOpnType map[string][]admissionregistrationv1.OperationType) []admissionregistrationv1.MutatingWebhook {
|
||||||
mutatingWebhooks := make([]admissionregistrationv1.MutatingWebhook, 0, len(webhooks))
|
var mutatingWebhooks []admissionregistrationv1.MutatingWebhook //nolint:prealloc
|
||||||
for _, webhook := range webhooks {
|
for _, webhook := range webhooks {
|
||||||
if webhook.isEmpty() {
|
if webhook.isEmpty() {
|
||||||
continue
|
continue
|
||||||
|
@ -1046,7 +1046,7 @@ func (c *controller) buildResourceValidatingWebhookConfiguration(ctx context.Con
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *controller) buildResourceValidatingWebhookRules(caBundle []byte, webhookCfg config.WebhookConfig, sideEffects *admissionregistrationv1.SideEffectClass, webhooks []*webhook, mapResourceToOpnType map[string][]admissionregistrationv1.OperationType) []admissionregistrationv1.ValidatingWebhook {
|
func (c *controller) buildResourceValidatingWebhookRules(caBundle []byte, webhookCfg config.WebhookConfig, sideEffects *admissionregistrationv1.SideEffectClass, webhooks []*webhook, mapResourceToOpnType map[string][]admissionregistrationv1.OperationType) []admissionregistrationv1.ValidatingWebhook {
|
||||||
validatingWebhooks := make([]admissionregistrationv1.ValidatingWebhook, 0, len(webhooks))
|
var validatingWebhooks []admissionregistrationv1.ValidatingWebhook //nolint:prealloc
|
||||||
for _, webhook := range webhooks {
|
for _, webhook := range webhooks {
|
||||||
if webhook.isEmpty() {
|
if webhook.isEmpty() {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue