Skip to content

Commit dc4a511

Browse files
fix(webhook): remove leading slash prepended to cluster name
The webhook server was prepending "/" to the cluster name extracted from UserInfo.Extra (e.g. "demo-project-abc" → "/demo-project-abc") as a workaround for the milo provider registering clusters under a "/namespace/name" style key. milo v0.28.1 (pulled in via the go.mod bump in v0.22.0) fixed the provider to register clusters under just the project name — matching exactly what the webhook already has from UserInfo.Extra. The workaround is now counterproductive: the webhook looks up "/demo-project-abc" but the cluster is registered as "demo-project-abc", so every Gateway admission webhook call returns "cluster not found" and is rejected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a238174 commit dc4a511

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

internal/webhook/server.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ func (s *clusterAwareWebhookServer) Register(path string, hook http.Handler) {
2424
orig := h.Handler
2525
h.Handler = admission.HandlerFunc(func(ctx context.Context, req admission.Request) admission.Response {
2626
c := clusterFromExtra(req.UserInfo.Extra)
27-
if len(c) > 0 {
28-
// The cluster names are `<namespace>/<name>` format, but Milo project
29-
// discovery resources do not have namespaces and return a cluster name
30-
// with a leading `/`.
31-
//
32-
// In the future, this should be improved to allow the multicluster-provider
33-
// discovery mechanism to handle this somehow.
34-
35-
c = "/" + c
36-
}
3727
ctx = mccontext.WithCluster(ctx, multicluster.ClusterName(c))
3828
return orig.Handle(ctx, req)
3929
})

0 commit comments

Comments
 (0)