Skip to content

Commit dedaf38

Browse files
committed
fix: allow empty cluster
1 parent a7620b1 commit dedaf38

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/webhook/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ func (s *clusterAwareWebhookServer) Register(path string, hook http.Handler) {
1818
if h, ok := hook.(*admission.Webhook); ok {
1919
orig := h.Handler
2020
h.Handler = admission.HandlerFunc(func(ctx context.Context, req admission.Request) admission.Response {
21-
if c := clusterFromExtra(req.UserInfo.Extra); c != "" {
22-
ctx = WithClusterName(ctx, c)
23-
}
21+
c := clusterFromExtra(req.UserInfo.Extra)
22+
ctx = WithClusterName(ctx, c)
2423
return orig.Handle(ctx, req)
2524
})
2625
}

0 commit comments

Comments
 (0)