Merge pull request #74239 from tossmilestone/fix-dup-container-param

Fix duplicate container query param on exec pod command
pull/564/head
Kubernetes Prow Robot 2019-02-19 15:06:00 -08:00 committed by GitHub
commit e1b8cb515c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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,

View File

@ -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)
}