@@ -16,7 +16,7 @@ import (
1616
1717var (
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 {
@@ -627,6 +627,12 @@ func (g *Generator) SetLinuxIntelRdtL3CacheSchema(schema string) {
627627 g .Config .Linux .IntelRdt .L3CacheSchema = schema
628628}
629629
630+ // SetLinuxTimeOffset sets g.Config.Linux.TimeOffsets[clock]
631+ func (g * Generator ) SetLinuxTimeOffset (clock string , offset rspec.LinuxTimeOffset ) {
632+ g .initConfigLinuxTimeOffsets ()
633+ g .Config .Linux .TimeOffsets [clock ] = offset
634+ }
635+
630636// SetLinuxMountLabel sets g.Config.Linux.MountLabel.
631637func (g * Generator ) SetLinuxMountLabel (label string ) {
632638 g .initConfigLinux ()
@@ -1479,6 +1485,8 @@ func mapStrToNamespace(ns string, path string) (rspec.LinuxNamespace, error) {
14791485 return rspec.LinuxNamespace {Type : rspec .UserNamespace , Path : path }, nil
14801486 case "cgroup" :
14811487 return rspec.LinuxNamespace {Type : rspec .CgroupNamespace , Path : path }, nil
1488+ case "time" :
1489+ return rspec.LinuxNamespace {Type : rspec .TimeNamespace , Path : path }, nil
14821490 default :
14831491 return rspec.LinuxNamespace {}, fmt .Errorf ("unrecognized namespace %q" , ns )
14841492 }
0 commit comments