本文整理汇总了Golang中github.com/juju/juju/environs/config.Config.ControllerUUID方法的典型用法代码示例。如果您正苦于以下问题:Golang Config.ControllerUUID方法的具体用法?Golang Config.ControllerUUID怎么用?Golang Config.ControllerUUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/environs/config.Config
的用法示例。
在下文中一共展示了Config.ControllerUUID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: InstanceTags
// InstanceTags returns the minimum set of tags that should be set on a
// machine instance, if the provider supports them.
func InstanceTags(cfg *config.Config, jobs []multiwatcher.MachineJob) map[string]string {
instanceTags := tags.ResourceTags(
names.NewModelTag(cfg.UUID()),
names.NewModelTag(cfg.ControllerUUID()),
cfg,
)
if multiwatcher.AnyJobNeedsState(jobs...) {
instanceTags[tags.JujuIsController] = "true"
}
return instanceTags
}
示例2: storageTags
// storageTags returns the tags that should be set on a volume or filesystem,
// if the provider supports them.
func storageTags(
storageInstance state.StorageInstance,
cfg *config.Config,
) (map[string]string, error) {
storageTags := tags.ResourceTags(
names.NewModelTag(cfg.UUID()),
names.NewModelTag(cfg.ControllerUUID()),
cfg,
)
if storageInstance != nil {
storageTags[tags.JujuStorageInstance] = storageInstance.Tag().Id()
storageTags[tags.JujuStorageOwner] = storageInstance.Owner().Id()
}
return storageTags, nil
}
示例3: Open
func (p *environProvider) Open(cfg *config.Config) (environs.Environ, error) {
p.mu.Lock()
defer p.mu.Unlock()
ecfg, err := p.newConfig(cfg)
if err != nil {
return nil, err
}
if _, ok := p.state[cfg.ControllerUUID()]; !ok {
return nil, errNotPrepared
}
env := &environ{
name: ecfg.Name(),
ecfgUnlocked: ecfg,
}
if err := env.checkBroken("Open"); err != nil {
return nil, err
}
return env, nil
}
示例4: controllerValues
func controllerValues(config *config.Config) map[string]interface{} {
result := make(map[string]interface{})
result["state-port"] = config.StatePort()
result["api-port"] = config.APIPort()
result["controller-uuid"] = config.ControllerUUID()
// We ignore the second bool param from the CACert check as if there
// wasn't a CACert, there is no way we'd be importing a new model
// into the controller
result["ca-cert"], _ = config.CACert()
return result
}