dependencies: update runc to v1.1.13
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
19
vendor/github.com/opencontainers/runc/libcontainer/init_linux.go
generated
vendored
19
vendor/github.com/opencontainers/runc/libcontainer/init_linux.go
generated
vendored
@@ -10,6 +10,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/containerd/console"
|
||||
@@ -84,6 +85,11 @@ func newContainerInit(t initType, pipe *os.File, consoleSocket *os.File, fifoFd,
|
||||
if err := populateProcessEnvironment(config.Env); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Clean the RLIMIT_NOFILE cache in go runtime.
|
||||
// Issue: https://github.com/opencontainers/runc/issues/4195
|
||||
maybeClearRlimitNofileCache(config.Rlimits)
|
||||
|
||||
switch t {
|
||||
case initSetns:
|
||||
// mountFds must be nil in this case. We don't mount while doing runc exec.
|
||||
@@ -261,7 +267,6 @@ func setupConsole(socket *os.File, config *initConfig, mount bool) error {
|
||||
Height: config.ConsoleHeight,
|
||||
Width: config.ConsoleWidth,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -518,6 +523,18 @@ func setupRoute(config *configs.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func maybeClearRlimitNofileCache(limits []configs.Rlimit) {
|
||||
for _, rlimit := range limits {
|
||||
if rlimit.Type == syscall.RLIMIT_NOFILE {
|
||||
system.ClearRlimitNofileCache(&syscall.Rlimit{
|
||||
Cur: rlimit.Soft,
|
||||
Max: rlimit.Hard,
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func setupRlimits(limits []configs.Rlimit, pid int) error {
|
||||
for _, rlimit := range limits {
|
||||
if err := unix.Prlimit(pid, rlimit.Type, &unix.Rlimit{Max: rlimit.Hard, Cur: rlimit.Soft}, nil); err != nil {
|
||||
|
Reference in New Issue
Block a user