Update containerd dependencies
sys/unix cgroups go-runc console Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
3
vendor/github.com/containerd/cgroups/cgroup.go
generated
vendored
3
vendor/github.com/containerd/cgroups/cgroup.go
generated
vendored
@@ -245,6 +245,9 @@ func (c *cgroup) processes(subsystem Name, recursive bool) ([]Process, error) {
|
||||
return err
|
||||
}
|
||||
if !recursive && info.IsDir() {
|
||||
if p == path {
|
||||
return nil
|
||||
}
|
||||
return filepath.SkipDir
|
||||
}
|
||||
dir, name := filepath.Split(p)
|
||||
|
||||
9
vendor/github.com/containerd/cgroups/cpuset.go
generated
vendored
9
vendor/github.com/containerd/cgroups/cpuset.go
generated
vendored
@@ -84,15 +84,14 @@ func (c *cpusetController) ensureParent(current, root string) error {
|
||||
if _, err := filepath.Rel(root, parent); err != nil {
|
||||
return nil
|
||||
}
|
||||
if cleanPath(parent) == root {
|
||||
return nil
|
||||
}
|
||||
// Avoid infinite recursion.
|
||||
if parent == current {
|
||||
return fmt.Errorf("cpuset: cgroup parent path outside cgroup root")
|
||||
}
|
||||
if err := c.ensureParent(parent, root); err != nil {
|
||||
return err
|
||||
if cleanPath(parent) != root {
|
||||
if err := c.ensureParent(parent, root); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := os.MkdirAll(current, defaultDirPerm); err != nil {
|
||||
return err
|
||||
|
||||
5
vendor/github.com/containerd/cgroups/ticks.go
generated
vendored
5
vendor/github.com/containerd/cgroups/ticks.go
generated
vendored
@@ -1,5 +1,10 @@
|
||||
package cgroups
|
||||
|
||||
func getClockTicks() uint64 {
|
||||
// The value comes from `C.sysconf(C._SC_CLK_TCK)`, and
|
||||
// on Linux it's a constant which is safe to be hard coded,
|
||||
// so we can avoid using cgo here.
|
||||
// See https://github.com/containerd/cgroups/pull/12 for
|
||||
// more details.
|
||||
return 100
|
||||
}
|
||||
|
||||
4
vendor/github.com/containerd/cgroups/utils.go
generated
vendored
4
vendor/github.com/containerd/cgroups/utils.go
generated
vendored
@@ -207,7 +207,9 @@ func parseCgroupFromReader(r io.Reader) (map[string]string, error) {
|
||||
return nil, fmt.Errorf("invalid cgroup entry: must contain at least two colons: %v", text)
|
||||
}
|
||||
for _, subs := range strings.Split(parts[1], ",") {
|
||||
cgroups[subs] = parts[2]
|
||||
if subs != "" {
|
||||
cgroups[subs] = parts[2]
|
||||
}
|
||||
}
|
||||
}
|
||||
return cgroups, nil
|
||||
|
||||
2
vendor/github.com/containerd/console/console.go
generated
vendored
2
vendor/github.com/containerd/console/console.go
generated
vendored
@@ -26,6 +26,8 @@ type Console interface {
|
||||
Reset() error
|
||||
// Size returns the window size of the console
|
||||
Size() (WinSize, error)
|
||||
// Fd returns the console's file descriptor
|
||||
Fd() uintptr
|
||||
}
|
||||
|
||||
// WinSize specifies the window size of the console
|
||||
|
||||
4
vendor/github.com/containerd/console/console_unix.go
generated
vendored
4
vendor/github.com/containerd/console/console_unix.go
generated
vendored
@@ -114,6 +114,10 @@ func (m *master) Size() (WinSize, error) {
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
func (m *master) Fd() uintptr {
|
||||
return m.f.Fd()
|
||||
}
|
||||
|
||||
// checkConsole checks if the provided file is a console
|
||||
func checkConsole(f *os.File) error {
|
||||
var termios unix.Termios
|
||||
|
||||
4
vendor/github.com/containerd/console/console_windows.go
generated
vendored
4
vendor/github.com/containerd/console/console_windows.go
generated
vendored
@@ -150,6 +150,10 @@ func (m *master) Write(b []byte) (int, error) {
|
||||
panic("not implemented on windows")
|
||||
}
|
||||
|
||||
func (m *master) Fd() uintptr {
|
||||
return m.in
|
||||
}
|
||||
|
||||
// makeInputRaw puts the terminal (Windows Console) connected to the given
|
||||
// file descriptor into raw mode
|
||||
func makeInputRaw(fd uintptr, mode uint32) error {
|
||||
|
||||
14
vendor/github.com/containerd/console/tc_linux.go
generated
vendored
14
vendor/github.com/containerd/console/tc_linux.go
generated
vendored
@@ -9,11 +9,16 @@ import (
|
||||
)
|
||||
|
||||
func tcget(fd uintptr, p *unix.Termios) error {
|
||||
return ioctl(fd, unix.TCGETS, uintptr(unsafe.Pointer(p)))
|
||||
termios, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*p = *termios
|
||||
return nil
|
||||
}
|
||||
|
||||
func tcset(fd uintptr, p *unix.Termios) error {
|
||||
return ioctl(fd, unix.TCSETS, uintptr(unsafe.Pointer(p)))
|
||||
return unix.IoctlSetTermios(int(fd), unix.TCSETS, p)
|
||||
}
|
||||
|
||||
func ioctl(fd, flag, data uintptr) error {
|
||||
@@ -32,15 +37,14 @@ func unlockpt(f *os.File) error {
|
||||
|
||||
// ptsname retrieves the name of the first available pts for the given master.
|
||||
func ptsname(f *os.File) (string, error) {
|
||||
var n int32
|
||||
if err := ioctl(f.Fd(), unix.TIOCGPTN, uintptr(unsafe.Pointer(&n))); err != nil {
|
||||
n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return fmt.Sprintf("/dev/pts/%d", n), nil
|
||||
}
|
||||
|
||||
func saneTerminal(f *os.File) error {
|
||||
// Go doesn't have a wrapper for any of the termios ioctls.
|
||||
var termios unix.Termios
|
||||
if err := tcget(f.Fd(), &termios); err != nil {
|
||||
return err
|
||||
|
||||
10
vendor/github.com/containerd/go-runc/command_linux.go
generated
vendored
10
vendor/github.com/containerd/go-runc/command_linux.go
generated
vendored
@@ -12,10 +12,12 @@ func (r *Runc) command(context context.Context, args ...string) *exec.Cmd {
|
||||
command = DefaultCommand
|
||||
}
|
||||
cmd := exec.CommandContext(context, command, append(r.args(), args...)...)
|
||||
if r.PdeathSignal != 0 {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Pdeathsig: r.PdeathSignal,
|
||||
}
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Setpgid: r.Setpgid,
|
||||
}
|
||||
if r.PdeathSignal != 0 {
|
||||
cmd.SysProcAttr.Pdeathsig = r.PdeathSignal
|
||||
}
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
10
vendor/github.com/containerd/go-runc/monitor.go
generated
vendored
10
vendor/github.com/containerd/go-runc/monitor.go
generated
vendored
@@ -42,9 +42,13 @@ func (m *defaultMonitor) Start(c *exec.Cmd) error {
|
||||
}
|
||||
|
||||
func (m *defaultMonitor) Wait(c *exec.Cmd) (int, error) {
|
||||
status, err := c.Process.Wait()
|
||||
if err != nil {
|
||||
if err := c.Wait(); err != nil {
|
||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||
if status, ok := exitErr.Sys().(syscall.WaitStatus); ok {
|
||||
return status.ExitStatus(), nil
|
||||
}
|
||||
}
|
||||
return -1, err
|
||||
}
|
||||
return status.Sys().(syscall.WaitStatus).ExitStatus(), nil
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
1
vendor/github.com/containerd/go-runc/runc.go
generated
vendored
1
vendor/github.com/containerd/go-runc/runc.go
generated
vendored
@@ -39,6 +39,7 @@ type Runc struct {
|
||||
Log string
|
||||
LogFormat Format
|
||||
PdeathSignal syscall.Signal
|
||||
Setpgid bool
|
||||
Criu string
|
||||
SystemdCgroup string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user