本文整理匯總了Golang中github.com/juju/juju/worker/provisioner.NewContainerProvisioner函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewContainerProvisioner函數的具體用法?Golang NewContainerProvisioner怎麽用?Golang NewContainerProvisioner使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewContainerProvisioner函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newKvmProvisioner
func (s *kvmProvisionerSuite) newKvmProvisioner(c *gc.C) provisioner.Provisioner {
machineTag := names.NewMachineTag("0")
agentConfig := s.AgentConfigForTag(c, machineTag)
managerConfig := container.ManagerConfig{container.ConfigName: "juju"}
broker, err := provisioner.NewKvmBroker(s.provisioner, agentConfig, managerConfig)
c.Assert(err, gc.IsNil)
return provisioner.NewContainerProvisioner(instance.KVM, s.provisioner, agentConfig, broker)
}
示例2: newLxcProvisioner
func (s *lxcProvisionerSuite) newLxcProvisioner(c *gc.C) provisioner.Provisioner {
parentMachineTag := names.NewMachineTag("0")
agentConfig := s.AgentConfigForTag(c, parentMachineTag)
managerConfig := container.ManagerConfig{container.ConfigName: "juju", "use-clone": "false"}
broker, err := provisioner.NewLxcBroker(s.provisioner, agentConfig, managerConfig)
c.Assert(err, gc.IsNil)
return provisioner.NewContainerProvisioner(instance.LXC, s.provisioner, agentConfig, broker)
}
示例3: newKvmProvisioner
func (s *kvmProvisionerSuite) newKvmProvisioner(c *gc.C) provisioner.Provisioner {
machineTag := names.NewMachineTag("0")
agentConfig := s.AgentConfigForTag(c, machineTag)
managerConfig := container.ManagerConfig{container.ConfigModelUUID: coretesting.ModelTag.Id()}
broker, err := provisioner.NewKvmBroker(s.provisioner, agentConfig, managerConfig)
c.Assert(err, jc.ErrorIsNil)
toolsFinder := (*provisioner.GetToolsFinder)(s.provisioner)
w, err := provisioner.NewContainerProvisioner(instance.KVM, s.provisioner, agentConfig, broker, toolsFinder)
c.Assert(err, jc.ErrorIsNil)
return w
}
示例4: newLxcProvisioner
func (s *lxcProvisionerSuite) newLxcProvisioner(c *gc.C) provisioner.Provisioner {
parentMachineTag := names.NewMachineTag("0")
agentConfig := s.AgentConfigForTag(c, parentMachineTag)
managerConfig := container.ManagerConfig{
container.ConfigName: "juju",
"log-dir": c.MkDir(),
"use-clone": "false",
}
broker, err := provisioner.NewLxcBroker(s.provisioner, agentConfig, managerConfig, &containertesting.MockURLGetter{}, false, 0)
c.Assert(err, jc.ErrorIsNil)
toolsFinder := (*provisioner.GetToolsFinder)(s.provisioner)
return provisioner.NewContainerProvisioner(instance.LXC, s.provisioner, agentConfig, broker, toolsFinder)
}