コード例 #1
0
ファイル: server.go プロジェクト: liyangdal/kurma
// 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
}
コード例 #2
0
ファイル: bootstrap.go プロジェクト: liyangdal/kurma
// 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
}