当前位置: 首页>>代码示例>>Golang>>正文


Golang kvm.NewContainerManager函数代码示例

本文整理汇总了Golang中github.com/juju/juju/container/kvm.NewContainerManager函数的典型用法代码示例。如果您正苦于以下问题:Golang NewContainerManager函数的具体用法?Golang NewContainerManager怎么用?Golang NewContainerManager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NewContainerManager函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: SetUpTest

func (s *KVMSuite) SetUpTest(c *gc.C) {
	s.TestSuite.SetUpTest(c)
	var err error
	s.manager, err = kvm.NewContainerManager(
		container.ManagerConfig{container.ConfigModelUUID: coretesting.ModelTag.Id()})
	c.Assert(err, jc.ErrorIsNil)
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:kvm_test.go

示例2: TestManagerWarnsAboutUnknownOption

func (*KVMSuite) TestManagerWarnsAboutUnknownOption(c *gc.C) {
	_, err := kvm.NewContainerManager(container.ManagerConfig{
		container.ConfigName: "BillyBatson",
		"shazam":             "Captain Marvel",
	})
	c.Assert(err, gc.IsNil)
	c.Assert(c.GetTestLog(), jc.Contains, `WARNING juju.container unused config option: "shazam" -> "Captain Marvel"`)
}
开发者ID:klyachin,项目名称:juju,代码行数:8,代码来源:kvm_test.go

示例3: TestManagerWarnsAboutUnknownOption

func (*KVMSuite) TestManagerWarnsAboutUnknownOption(c *gc.C) {
	_, err := kvm.NewContainerManager(container.ManagerConfig{
		container.ConfigModelUUID: coretesting.ModelTag.Id(),
		"shazam":                  "Captain Marvel",
	})
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(c.GetTestLog(), jc.Contains, `INFO juju.container unused config option: "shazam" -> "Captain Marvel"`)
}
开发者ID:bac,项目名称:juju,代码行数:8,代码来源:kvm_test.go

示例4: NewContainerManager

// NewContainerManager creates the appropriate container.Manager for the
// specified container type.
func NewContainerManager(forType instance.ContainerType, conf container.ManagerConfig, imageURLGetter container.ImageURLGetter) (container.Manager, error) {
	switch forType {
	case instance.LXC:
		return lxc.NewContainerManager(conf, imageURLGetter, looputil.NewLoopDeviceManager())
	case instance.KVM:
		return kvm.NewContainerManager(conf)
	}
	return nil, errors.Errorf("unknown container type: %q", forType)
}
开发者ID:imoapps,项目名称:juju,代码行数:11,代码来源:factory.go

示例5: newManager

func (s *LiveSuite) newManager(c *gc.C, name string) container.Manager {
	manager, err := kvm.NewContainerManager(
		container.ManagerConfig{
			container.ConfigName:   name,
			container.ConfigLogDir: c.MkDir(),
		})
	c.Assert(err, jc.ErrorIsNil)
	return manager
}
开发者ID:imoapps,项目名称:juju,代码行数:9,代码来源:live_test.go

示例6: NewContainerManager

// NewContainerManager creates the appropriate container.Manager for the
// specified container type.
func NewContainerManager(forType instance.ContainerType, conf container.ManagerConfig) (container.Manager, error) {
	switch forType {
	case instance.LXC:
		return lxc.NewContainerManager(conf)
	case instance.KVM:
		return kvm.NewContainerManager(conf)
	}
	return nil, fmt.Errorf("unknown container type: %q", forType)
}
开发者ID:jiasir,项目名称:juju,代码行数:11,代码来源:factory.go

示例7: newManager

func (s *LiveSuite) newManager(c *gc.C, name string) container.Manager {
	manager, err := kvm.NewContainerManager(
		container.ManagerConfig{
			container.ConfigModelUUID: coretesting.ModelTag.Id(),
			container.ConfigLogDir:    c.MkDir(),
		})
	c.Assert(err, jc.ErrorIsNil)
	return manager
}
开发者ID:bac,项目名称:juju,代码行数:9,代码来源:live_test.go

示例8: NewKvmBroker

func NewKvmBroker(
	api APICalls,
	agentConfig agent.Config,
	managerConfig container.ManagerConfig,
) (environs.InstanceBroker, error) {
	manager, err := kvm.NewContainerManager(managerConfig)
	if err != nil {
		return nil, err
	}
	return &kvmBroker{
		manager:     manager,
		api:         api,
		agentConfig: agentConfig,
	}, nil
}
开发者ID:bac,项目名称:juju,代码行数:15,代码来源:kvm-broker.go

示例9: NewKvmBroker

func NewKvmBroker(
	api APICalls,
	agentConfig agent.Config,
	managerConfig container.ManagerConfig,
	enableNAT bool,
) (environs.InstanceBroker, error) {
	namespace := maybeGetManagerConfigNamespaces(managerConfig)
	manager, err := kvm.NewContainerManager(managerConfig)
	if err != nil {
		return nil, err
	}
	return &kvmBroker{
		manager:     manager,
		namespace:   namespace,
		api:         api,
		agentConfig: agentConfig,
		enableNAT:   enableNAT,
	}, nil
}
开发者ID:makyo,项目名称:juju,代码行数:19,代码来源:kvm-broker.go

示例10: TestManagerNameNeeded

func (*KVMSuite) TestManagerNameNeeded(c *gc.C) {
	manager, err := kvm.NewContainerManager(container.ManagerConfig{container.ConfigName: ""})
	c.Assert(err, gc.ErrorMatches, "name is required")
	c.Assert(manager, gc.IsNil)
}
开发者ID:klyachin,项目名称:juju,代码行数:5,代码来源:kvm_test.go

示例11: SetUpTest

func (s *KVMSuite) SetUpTest(c *gc.C) {
	s.TestSuite.SetUpTest(c)
	var err error
	s.manager, err = kvm.NewContainerManager(container.ManagerConfig{container.ConfigName: "test"})
	c.Assert(err, gc.IsNil)
}
开发者ID:klyachin,项目名称:juju,代码行数:6,代码来源:kvm_test.go

示例12: TestManagerModelUUIDNeeded

func (*KVMSuite) TestManagerModelUUIDNeeded(c *gc.C) {
	manager, err := kvm.NewContainerManager(container.ManagerConfig{container.ConfigModelUUID: ""})
	c.Assert(err, gc.ErrorMatches, "model UUID is required")
	c.Assert(manager, gc.IsNil)
}
开发者ID:bac,项目名称:juju,代码行数:5,代码来源:kvm_test.go


注:本文中的github.com/juju/juju/container/kvm.NewContainerManager函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。