當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。