diff --git a/pkg/search/proxy/framework/plugins/cluster/cluster.go b/pkg/search/proxy/framework/plugins/cluster/cluster.go index 9c75c4e81154..5f4f5f58caba 100644 --- a/pkg/search/proxy/framework/plugins/cluster/cluster.go +++ b/pkg/search/proxy/framework/plugins/cluster/cluster.go @@ -63,7 +63,10 @@ func (c *Cluster) SupportRequest(request framework.ProxyRequest) bool { func (c *Cluster) Connect(ctx context.Context, request framework.ProxyRequest) (http.Handler, error) { requestInfo := request.RequestInfo - if requestInfo.Verb == "create" { + // For creating request, cluster proxy doesn't know which cluster to create, so responses MethodNotSupported error. + // While for subresource request, having resource name request (like pods attach, exec and port-forward), + // proxy it to the cluster the resource located. + if requestInfo.Verb == "create" && requestInfo.Name == "" { return nil, apierrors.NewMethodNotSupported(request.GroupVersionResource.GroupResource(), requestInfo.Verb) }