mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 21:53:52 +00:00
Merge pull request #10509 from nikhiljindal/getToPost
Support both GET and POST methods in api server for /exec and /portforward
This commit is contained in:
@@ -280,7 +280,8 @@ func (r *ProxyREST) Connect(ctx api.Context, id string, opts runtime.Object) (re
|
||||
return genericrest.NewUpgradeAwareProxyHandler(location, nil, false), nil
|
||||
}
|
||||
|
||||
var upgradeableMethods = []string{"GET"}
|
||||
// Support both GET and POST methods. Over time, we want to move all clients to start using POST and then stop supporting GET.
|
||||
var upgradeableMethods = []string{"GET", "POST"}
|
||||
|
||||
// ExecREST implements the exec subresource for a Pod
|
||||
type ExecREST struct {
|
||||
|
@@ -249,7 +249,7 @@ func ExecLocation(getter ResourceGetter, connInfo client.ConnectionInfoGetter, c
|
||||
nodeHost := pod.Spec.NodeName
|
||||
if len(nodeHost) == 0 {
|
||||
// If pod has not been assigned a host, return an empty location
|
||||
return nil, nil, fmt.Errorf("pod %s does not have a host assigned", name)
|
||||
return nil, nil, errors.NewBadRequest(fmt.Sprintf("pod %s does not have a host assigned", name))
|
||||
}
|
||||
nodeScheme, nodePort, nodeTransport, err := connInfo.GetConnectionInfo(nodeHost)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user