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

Add time namespace #784

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

var (
// Namespaces include the names of supported namespaces.
Namespaces = []string{"network", "pid", "mount", "ipc", "uts", "user", "cgroup"}
Namespaces = []string{"network", "pid", "mount", "ipc", "uts", "user", "cgroup", "time"}

// we don't care about order...and this is way faster...
removeFunc = func(s []string, i int) []string {
Expand Down Expand Up @@ -1478,6 +1478,8 @@ func mapStrToNamespace(ns string, path string) (rspec.LinuxNamespace, error) {
return rspec.LinuxNamespace{Type: rspec.UserNamespace, Path: path}, nil
case "cgroup":
return rspec.LinuxNamespace{Type: rspec.CgroupNamespace, Path: path}, nil
case "time":
return rspec.LinuxNamespace{Type: rspec.TimeNamespace, Path: path}, nil
default:
return rspec.LinuxNamespace{}, fmt.Errorf("unrecognized namespace %q", ns)
}
Expand Down
1 change: 1 addition & 0 deletions validate/validate_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (v *Validator) CheckLinux() (errs error) {
rspec.UTSNamespace: {0, false},
rspec.UserNamespace: {0, false},
rspec.CgroupNamespace: {0, false},
rspec.TimeNamespace: {0, false},
}

for index := 0; index < len(v.spec.Linux.Namespaces); index++ {
Expand Down