Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit c7135ec

Browse files
authored
Merge pull request #144 from resouer/fix-timeout
Fix timeout when exec/attach
2 parents 83ca08b + 5d778f3 commit c7135ec

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/hypernetes-demo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ spec:
6868
containers:
6969
- name: busybox
7070
image: busybox
71+
command:
72+
- "top"
7173
EOF
7274
}
7375

pkg/kubelet/hyper/hyperclient.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func (c *HyperClient) Attach(opts AttachToContainerOptions) error {
413413
return fmt.Errorf("No Such Container %s", opts.Container)
414414
}
415415

416-
ctx, cancel := getContextWithTimeout(hyperContextTimeout)
416+
ctx, cancel := getContextWithCancel()
417417
defer cancel()
418418

419419
stream, err := c.client.Attach(ctx)
@@ -499,7 +499,7 @@ func (c *HyperClient) Exec(opts ExecInContainerOptions) error {
499499
Tty: opts.TTY,
500500
}
501501

502-
ctx, cancel := getContextWithTimeout(hyperContextTimeout)
502+
ctx, cancel := getContextWithCancel()
503503
defer cancel()
504504

505505
createResponse, err := c.client.ExecCreate(ctx, &createRequest)

0 commit comments

Comments
 (0)