Skip to content

Commit cd89e56

Browse files
committed
scaffold: remove unnecessary fmt.Sprintf invocation
1 parent 2cc7d14 commit cd89e56

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scaffold/templates/api/__groupVersion__/webhook.go.tpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package {{ .groupVersion }}
1919

2020
import (
2121
"context"
22-
"fmt"
2322

2423
"sigs.k8s.io/controller-runtime/pkg/manager"
2524

@@ -72,13 +71,13 @@ func (w *Webhook) MutateUpdate(ctx context.Context, oldComponent *{{ .kind }}, c
7271
func (w *Webhook) SetupWithManager(mgr manager.Manager) {
7372
{{- if .validatingWebhookEnabled }}
7473
mgr.GetWebhookServer().Register(
75-
fmt.Sprintf("/admission/%s/{{ .resource }}/validate", GroupVersion),
74+
"/admission/{{ .groupName }}/{{ .groupVersion }}/{{ .resource }}/validate",
7675
admission.NewValidatingWebhookHandler[*{{ .kind }}](w, mgr.GetScheme(), mgr.GetLogger().WithName("webhook-runtime")),
7776
)
7877
{{- end }}
7978
{{- if .mutatingWebhookEnabled }}
8079
mgr.GetWebhookServer().Register(
81-
fmt.Sprintf("/admission/%s/{{ .resource }}/mutate", GroupVersion),
80+
"/admission/{{ .groupName }}/{{ .groupVersion }}/{{ .resource }}/mutate",
8281
admission.NewMutatingWebhookHandler[*{{ .kind }}](w, mgr.GetScheme(), mgr.GetLogger().WithName("webhook-runtime")),
8382
)
8483
{{- end }}

0 commit comments

Comments
 (0)