Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upstream libcontainer dependency - Try 2 #5438

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion drivers/shared/executor/executor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (l *LibcontainerExecutor) Launch(command *ExecCommand) (*ProcessState, erro
factory, err := libcontainer.New(
path.Join(command.TaskDir, "../alloc/container"),
libcontainer.Cgroupfs,
libcontainer.InitArgs(bin, "libcontainer-shim"),
libcontainerInitArgs(bin, "libcontainer-shim"),
)
if err != nil {
return nil, fmt.Errorf("failed to create factory: %v", err)
Expand Down Expand Up @@ -763,3 +763,27 @@ func cmdMounts(mounts []*drivers.MountConfig) []*lconfigs.Mount {

return r
}

// libcontainerInitArgs returns an options func to configure a LinuxFactory with the
// provided init binary path and arguments.
//
// Workaround open PR https://github.com/opencontainers/runc/pull/1888
// remove when PR is merged
func libcontainerInitArgs(args ...string) func(*libcontainer.LinuxFactory) error {
return func(l *libcontainer.LinuxFactory) (err error) {
if len(args) == 0 {
return nil
}

// Resolve relative paths to ensure that its available
// after directory changes.
if args[0], err = filepath.Abs(args[0]); err != nil {
return fmt.Errorf("Invalid configuration: %v", err)
}

l.InitPath = args[0]
// libcontainer ignores InitArgs[0], so we don't remove it yet
l.InitArgs = args
return nil
}
}
201 changes: 201 additions & 0 deletions vendor/github.com/checkpoint-restore/go-criu/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading