Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #3098: support pod subresource (attach, exec, port-forward) through #3100

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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