Skip to content

Commit

Permalink
Merge pull request #3098 from ikaven1024/fix-proxy
Browse files Browse the repository at this point in the history
support pod subresource (attach, exec, port-forward) through global proxy
  • Loading branch information
karmada-bot authored Feb 2, 2023
2 parents 8f83031 + 167e132 commit 1d32ab6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/search/proxy/framework/plugins/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 1d32ab6

Please sign in to comment.