mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Fix attach, which was broken during the refactor
The new e2e test catches the break in attach (no e2e test exposed this codepath before).
This commit is contained in:
parent
e9a465d635
commit
7f6f85bd7b
@ -202,8 +202,14 @@ func (p *AttachOptions) Run() error {
|
|||||||
Resource("pods").
|
Resource("pods").
|
||||||
Name(pod.Name).
|
Name(pod.Name).
|
||||||
Namespace(pod.Namespace).
|
Namespace(pod.Namespace).
|
||||||
SubResource("attach").
|
SubResource("attach")
|
||||||
Param("container", p.GetContainerName(pod))
|
req.VersionedParams(&api.PodAttachOptions{
|
||||||
|
Container: p.GetContainerName(pod),
|
||||||
|
Stdin: stdin != nil,
|
||||||
|
Stdout: p.Out != nil,
|
||||||
|
Stderr: p.Err != nil,
|
||||||
|
TTY: tty,
|
||||||
|
}, api.Scheme)
|
||||||
|
|
||||||
return p.Attach.Attach("POST", req.URL(), p.Config, stdin, p.Out, p.Err, tty)
|
return p.Attach.Attach("POST", req.URL(), p.Config, stdin, p.Out, p.Err, tty)
|
||||||
}
|
}
|
||||||
|
@ -186,6 +186,9 @@ func TestAttach(t *testing.T) {
|
|||||||
if ex.method != "POST" {
|
if ex.method != "POST" {
|
||||||
t.Errorf("%s: Did not get method for attach request: %s", test.name, ex.method)
|
t.Errorf("%s: Did not get method for attach request: %s", test.name, ex.method)
|
||||||
}
|
}
|
||||||
|
if ex.url.Query().Get("container") != "bar" {
|
||||||
|
t.Errorf("%s: Did not have query parameters: %s", test.name, ex.url.Query())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user