Skip to content

Commit 1a9f2f8

Browse files
committed
Add time namespace
Signed-off-by: Etienne Champetier <[email protected]>
1 parent f7e3563 commit 1a9f2f8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

generate/generate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

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

2121
// we don't care about order...and this is way faster...
2222
removeFunc = func(s []string, i int) []string {
@@ -1478,6 +1478,8 @@ func mapStrToNamespace(ns string, path string) (rspec.LinuxNamespace, error) {
14781478
return rspec.LinuxNamespace{Type: rspec.UserNamespace, Path: path}, nil
14791479
case "cgroup":
14801480
return rspec.LinuxNamespace{Type: rspec.CgroupNamespace, Path: path}, nil
1481+
case "time":
1482+
return rspec.LinuxNamespace{Type: rspec.TimeNamespace, Path: path}, nil
14811483
default:
14821484
return rspec.LinuxNamespace{}, fmt.Errorf("unrecognized namespace %q", ns)
14831485
}

validate/validate_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func (v *Validator) CheckLinux() (errs error) {
6060
rspec.UTSNamespace: {0, false},
6161
rspec.UserNamespace: {0, false},
6262
rspec.CgroupNamespace: {0, false},
63+
rspec.TimeNamespace: {0, false},
6364
}
6465

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

0 commit comments

Comments
 (0)