From baf7a2805c1144eee9513fdafbf6e3a214d516b9 Mon Sep 17 00:00:00 2001 From: Wassim DHIF Date: Wed, 4 Sep 2024 15:21:45 +0200 Subject: [PATCH] fix(admission server): improve config methods naming Signed-off-by: Wassim DHIF --- pkg/clusteragent/admission/controllers/webhook/config.go | 4 ++-- .../admission/controllers/webhook/controller_base.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/clusteragent/admission/controllers/webhook/config.go b/pkg/clusteragent/admission/controllers/webhook/config.go index 867c692d41267e..86e1fa8bbeba00 100644 --- a/pkg/clusteragent/admission/controllers/webhook/config.go +++ b/pkg/clusteragent/admission/controllers/webhook/config.go @@ -54,8 +54,8 @@ func NewConfig(admissionV1Enabled, namespaceSelectorEnabled bool) Config { func (w *Config) getWebhookName() string { return w.webhookName } func (w *Config) getSecretName() string { return w.secretName } -func (w *Config) getValidationEnabled() bool { return w.validationEnabled } -func (w *Config) getMutationEnabled() bool { return w.mutationEnabled } +func (w *Config) isValidationEnabled() bool { return w.validationEnabled } +func (w *Config) isMutationEnabled() bool { return w.mutationEnabled } func (w *Config) getSecretNs() string { return w.namespace } func (w *Config) useAdmissionV1() bool { return w.admissionV1Enabled } func (w *Config) useNamespaceSelector() bool { return w.namespaceSelectorEnabled } diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_base.go b/pkg/clusteragent/admission/controllers/webhook/controller_base.go index 0bd3030f34937c..b7c43a0326ba67 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_base.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_base.go @@ -98,14 +98,14 @@ func (c *controllerBase) generateWebhooks(wmeta workloadmeta.Component, pa workl var mutatingWebhooks []Webhook // Add Validating webhooks. - if c.config.getValidationEnabled() { + if c.config.isValidationEnabled() { // Future validating webhooks can be added here. validatingWebhooks = []Webhook{} webhooks = append(webhooks, validatingWebhooks...) } // Add Mutating webhooks. - if c.config.getMutationEnabled() { + if c.config.isMutationEnabled() { mutatingWebhooks = []Webhook{ configWebhook.NewWebhook(wmeta, injectionFilter), tagsfromlabels.NewWebhook(wmeta, injectionFilter),