Commit Graph

19 Commits

Author SHA1 Message Date
Hsing-Yu (David) Chen
82ec62b865 fix: cio.Cancel() should close the pipes
PR fixes #8326.

Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
2023-03-30 18:39:21 -07:00
Maksym Pavlenko
3bc8fc4d30 Cleanup build constraints
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-08 09:36:20 -08:00
haoyun
bbe46b8c43 feat: replace github.com/pkg/errors to errors
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
2022-01-07 10:27:03 +08:00
Eng Zer Jun
50da673592
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-21 09:50:38 +08:00
Akihiro Suda
d3aa7ee9f0
Run go fmt with Go 1.17
The new `go fmt` adds `//go:build` lines (https://golang.org/doc/go1.17#tools).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-22 09:31:50 +09:00
Sebastiaan van Stijn
baf6c1d5e2
cio: openFifos() use named return variables to use in defer()
This change is mostly defensive; when checking for the returned
error, it's easy to make a mistake, and check for a "local" error,
not the actual returned error.

This patch changes the function to use a named return variable,
which is checked in the defer.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-01 11:17:54 +01:00
Wei Fu
68b736ddfc cio: should not open fifo for stderr if terminal
fix: #4342

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-07-02 11:49:31 +08:00
Lantao Liu
c410f0eaef Fix potential panic for task in unknown state.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-02 00:38:06 -07:00
John Howard
90caf6f6a7 Windows:NewDirectIOFromFIFOSet
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-01-15 10:04:43 -08:00
Derek McGowan
6b9be1bfc3
Fix creation of DirectIO overwriting fifo config
Creating a direct IO should not overwrite the fifo
configuration. The fifo configuration can be updated
before creating the direct io if needed.
This fixes an expected change in behavior for clients
who were calling NewDirectIO previously with terminal
configured on the fifo.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-01 16:04:22 -07:00
Evan Hazlett
6b4355d242 add NewDirectIOWithTerminal; add test for pty
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-04-25 16:17:10 -04:00
Stephen Day
0273e970a4
Merge pull request #2161 from IRCody/cio_panic
Fix panics in cio/io_unix.go
2018-02-26 13:45:45 -08:00
Cody Roseborough
4c5ebfee96 Fix panics in cio/io_unix.go
Add nil checks before closing fifos to avoid panic when fifo was never
opened.

Signed-off-by: Cody Roseborough <crrosebo@amazon.com>
2018-02-26 19:22:36 +00:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Stephen J Day
cd72819b53
archive, cio, cmd, linux: use buffer pools
To avoid buffer bloat in long running processes, we try to use buffer
pools where possible. This is meant to address shim memory usage issues,
but may not be the root cause.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2018-01-22 13:52:06 -08:00
Daniel Nephin
7d4337e738 Reduce the number of IO constructors
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-12-11 15:07:09 -05:00
Daniel Nephin
3146019918 Refactor cio.DirectIO
New code duplication
Better re-use from consumers of the cio package

TODO: io_windows.go

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-12-08 14:26:10 -05:00
Daniel Nephin
f79ec5b55f Cleanup cio.FIFOSet interface
Remove duplication with cio.Config
unexport newFIFOSetTempDir() since it includes hardcoded paths
Expose os.RemoveAll() as part of FIFOSet instead of a Dir

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-12-08 14:26:10 -05:00
Daniel Nephin
298dabc6c2 Move io.go into cio package
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-17 17:04:45 -05:00