@@ -17,7 +17,7 @@ import (
1717
1818var (
1919 // Namespaces include the names of supported namespaces.
20- Namespaces = []string {"network" , "pid" , "mount" , "ipc" , "uts" , "user" , "cgroup" }
20+ Namespaces = []string {"network" , "pid" , "mount" , "ipc" , "uts" , "user" , "cgroup" , "time" }
2121
2222 // we don't care about order...and this is way faster...
2323 removeFunc = func (s []string , i int ) []string {
@@ -633,6 +633,12 @@ func (g *Generator) SetLinuxIntelRdtL3CacheSchema(schema string) {
633633 g .Config .Linux .IntelRdt .L3CacheSchema = schema
634634}
635635
636+ // SetLinuxTimeOffset sets g.Config.Linux.TimeOffsets[clock]
637+ func (g * Generator ) SetLinuxTimeOffset (clock string , offset rspec.LinuxTimeOffset ) {
638+ g .initConfigLinuxTimeOffsets ()
639+ g .Config .Linux .TimeOffsets [clock ] = offset
640+ }
641+
636642// SetLinuxMountLabel sets g.Config.Linux.MountLabel.
637643func (g * Generator ) SetLinuxMountLabel (label string ) {
638644 g .initConfigLinux ()
@@ -1485,6 +1491,8 @@ func mapStrToNamespace(ns string, path string) (rspec.LinuxNamespace, error) {
14851491 return rspec.LinuxNamespace {Type : rspec .UserNamespace , Path : path }, nil
14861492 case "cgroup" :
14871493 return rspec.LinuxNamespace {Type : rspec .CgroupNamespace , Path : path }, nil
1494+ case "time" :
1495+ return rspec.LinuxNamespace {Type : rspec .TimeNamespace , Path : path }, nil
14881496 default :
14891497 return rspec.LinuxNamespace {}, fmt .Errorf ("unrecognized namespace %q" , ns )
14901498 }
0 commit comments