// initializeManager creates the stage0 manager object which will handle // container launching. func (s *Server) initializeManager() (*container.Manager, error) { mopts := &container.Options{ ParentCgroupName: s.options.ParentCgroupName, ContainerDirectory: s.options.ContainerDirectory, RequiredNamespaces: s.options.RequiredNamespaces, } m, err := container.NewManager(mopts) if err != nil { return nil, err } m.Log = s.log.Clone() return m, nil }
// launchManager creates the container manager to allow containers to be // launched. func (r *runner) launchManager() error { mopts := &container.Options{ ParentCgroupName: r.config.ParentCgroupName, ContainerDirectory: filepath.Join(kurmaPath, string(kurmaPathPods)), VolumeDirectory: filepath.Join(kurmaPath, string(kurmaPathVolumes)), RequiredNamespaces: r.config.RequiredNamespaces, } m, err := container.NewManager(mopts) if err != nil { return fmt.Errorf("failed to create the container manager: %v", err) } m.Log = r.log.Clone() r.manager = m r.log.Trace("Container Manager has been initialized.") os.Chdir("/var/kurma") return nil }