Skip to content

Commit 053bb39

Browse files
committed
fix: allow empty cluster
1 parent 1769ca7 commit 053bb39

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

internal/webhook/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ func (s *clusterAwareWebhookServer) Register(path string, hook http.Handler) {
2222
if h, ok := hook.(*admission.Webhook); ok {
2323
orig := h.Handler
2424
h.Handler = admission.HandlerFunc(func(ctx context.Context, req admission.Request) admission.Response {
25-
if c := clusterFromExtra(req.UserInfo.Extra); c != "" {
26-
ctx = mccontext.WithCluster(ctx, c)
27-
}
25+
c := clusterFromExtra(req.UserInfo.Extra)
26+
ctx = mccontext.WithCluster(ctx, c)
2827
return orig.Handle(ctx, req)
2928
})
3029
}

0 commit comments

Comments
 (0)