diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2019-08-09 21:54:41 +0200 |
---|---|---|
committer | Derek McGowan <derek@mcgstyle.net> | 2019-10-04 15:05:33 -0700 |
commit | 1617be92d301de1386adabad5f241d3653b6c8ff (patch) | |
tree | ad202947714418ec710d02ed7d78ce5a93dc1104 /vendor/github.com | |
parent | 12f9887c8edb38177041aa35fd7d948b5c64f15b (diff) | |
download | docker-1617be92d301de1386adabad5f241d3653b6c8ff.tar.gz |
bump containerd/go-runc e029b79d8cda8374981c64eba71f28ec38e5526f
- github.com/containerd/go-runc https://github.com/containerd/go-runc/compare/7d11b49dc0769f6dbb0d1b19f3d48524d1bad9ad...e029b79d8cda8374981c64eba71f28ec38e5526f
- containerd/go-runc#52 Fix Method of judging command execution failure
- fixes "init.pid: no such file or directory: unknown" errors
- containerd/go-runc#54 avoid setting NOTIFY_SOCKET from calling process
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Diffstat (limited to 'vendor/github.com')
-rw-r--r-- | vendor/github.com/containerd/go-runc/command_linux.go | 17 | ||||
-rw-r--r-- | vendor/github.com/containerd/go-runc/runc.go | 12 |
2 files changed, 26 insertions, 3 deletions
diff --git a/vendor/github.com/containerd/go-runc/command_linux.go b/vendor/github.com/containerd/go-runc/command_linux.go index 71b52f9de4..8a30f679d0 100644 --- a/vendor/github.com/containerd/go-runc/command_linux.go +++ b/vendor/github.com/containerd/go-runc/command_linux.go @@ -20,6 +20,7 @@ import ( "context" "os" "os/exec" + "strings" "syscall" ) @@ -32,10 +33,24 @@ func (r *Runc) command(context context.Context, args ...string) *exec.Cmd { cmd.SysProcAttr = &syscall.SysProcAttr{ Setpgid: r.Setpgid, } - cmd.Env = os.Environ() + cmd.Env = filterEnv(os.Environ(), "NOTIFY_SOCKET") // NOTIFY_SOCKET introduces a special behavior in runc but should only be set if invoked from systemd if r.PdeathSignal != 0 { cmd.SysProcAttr.Pdeathsig = r.PdeathSignal } return cmd } + +func filterEnv(in []string, names ...string) []string { + out := make([]string, 0, len(in)) +loop0: + for _, v := range in { + for _, k := range names { + if strings.HasPrefix(v, k+"=") { + continue loop0 + } + } + out = append(out, v) + } + return out +} diff --git a/vendor/github.com/containerd/go-runc/runc.go b/vendor/github.com/containerd/go-runc/runc.go index 96262afab3..613cc511c6 100644 --- a/vendor/github.com/containerd/go-runc/runc.go +++ b/vendor/github.com/containerd/go-runc/runc.go @@ -275,7 +275,11 @@ func (r *Runc) Run(context context.Context, id, bundle string, opts *CreateOpts) if err != nil { return -1, err } - return Monitor.Wait(cmd, ec) + status, err := Monitor.Wait(cmd, ec) + if err == nil && status != 0 { + err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + } + return status, err } type DeleteOpts struct { @@ -570,7 +574,11 @@ func (r *Runc) Restore(context context.Context, id, bundle string, opts *Restore } } } - return Monitor.Wait(cmd, ec) + status, err := Monitor.Wait(cmd, ec) + if err == nil && status != 0 { + err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + } + return status, err } // Update updates the current container with the provided resource spec |