本文整理汇总了Golang中github.com/juju/juju/api/agent.Entity.Tag方法的典型用法代码示例。如果您正苦于以下问题:Golang Entity.Tag方法的具体用法?Golang Entity.Tag怎么用?Golang Entity.Tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/api/agent.Entity
的用法示例。
在下文中一共展示了Entity.Tag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: setupContainerSupport
// setupContainerSupport determines what containers can be run on this machine and
// initialises suitable infrastructure to support such containers.
func (a *MachineAgent) setupContainerSupport(runner worker.Runner, st *api.State, entity *apiagent.Entity, agentConfig agent.Config) error {
var supportedContainers []instance.ContainerType
// We don't yet support nested lxc containers but anything else can run an LXC container.
if entity.ContainerType() != instance.LXC {
supportedContainers = append(supportedContainers, instance.LXC)
}
supportsKvm, err := kvm.IsKVMSupported()
if err != nil {
logger.Warningf("determining kvm support: %v\nno kvm containers possible", err)
}
if err == nil && supportsKvm {
supportedContainers = append(supportedContainers, instance.KVM)
}
return a.updateSupportedContainers(runner, st, entity.Tag(), supportedContainers, agentConfig)
}