mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Fix duplicate container query param on exec pod command
Signed-off-by: He Xiaoxi <xxhe@alauda.io>
This commit is contained in:
parent
72be2f40b7
commit
4c8d0a3cd4
@ -311,8 +311,7 @@ func (p *ExecOptions) Run() error {
|
||||
Resource("pods").
|
||||
Name(pod.Name).
|
||||
Namespace(pod.Namespace).
|
||||
SubResource("exec").
|
||||
Param("container", containerName)
|
||||
SubResource("exec")
|
||||
req.VersionedParams(&corev1.PodExecOptions{
|
||||
Container: containerName,
|
||||
Command: p.Command,
|
||||
|
@ -244,6 +244,10 @@ func TestExec(t *testing.T) {
|
||||
t.Errorf("%s: Did not get expected path for exec request", test.name)
|
||||
return
|
||||
}
|
||||
if strings.Count(ex.url.RawQuery, "container=bar") != 1 {
|
||||
t.Errorf("%s: Did not get expected container query param for exec request", test.name)
|
||||
return
|
||||
}
|
||||
if ex.method != "POST" {
|
||||
t.Errorf("%s: Did not get method for exec request: %s", test.name, ex.method)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user