Documentation ¶
Overview ¶
Package modelmanager provides the business logic for model management operations in the controller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelConfigCreator ¶
type ModelConfigCreator struct { // Provider will be used to obtain EnvironProviders for preparing // and validating configuration. Provider func(string) (environs.EnvironProvider, error) // FindTools, if non-nil, will be used to validate the agent-version // value in NewModelConfig if it differs from the base configuration. // // If FindTools is nil, agent-version may not be different to the // base configuration. FindTools func(version.Number) (tools.List, error) }
ModelConfigCreator provides a method of creating a new model config.
The zero value of ModelConfigCreator is usable with the limitations noted on each struct field.
func (ModelConfigCreator) NewModelConfig ¶
func (c ModelConfigCreator) NewModelConfig( cloud environscloudspec.CloudSpec, base *config.Config, attrs map[string]interface{}, ) (*config.Config, error)
NewModelConfig returns a new model config given a base (controller) config and a set of attributes that will be specific to the new model, overriding any non-restricted attributes in the base configuration. The resulting config will be suitable for creating a new model in state.
If "attrs" does not include a UUID, a new, random one will be generated and added to the config.
The config will be validated with the provider before being returned.