Skip to content

Commit

Permalink
fix(admission server): improve config methods naming
Browse files Browse the repository at this point in the history
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
  • Loading branch information
wdhif committed Sep 4, 2024
1 parent b7aeb92 commit baf7a28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/clusteragent/admission/controllers/webhook/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit baf7a28

Please sign in to comment.