Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeState ¶
func InitializeState( adminUser names.UserTag, c agent.ConfigSetter, cfg *config.Config, hostedModelConfigAttrs map[string]interface{}, machineCfg BootstrapMachineConfig, dialOpts mongo.DialOpts, policy state.Policy, ) (_ *state.State, _ *state.Machine, resultErr error)
InitializeState should be called on the bootstrap machine's agent configuration. It uses that information to create the controller, dial the controller, and initialize it. It also generates a new password for the bootstrap machine and calls Write to save the the configuration.
The cfg values will be stored in the state's ModelConfig; the machineCfg values will be used to configure the bootstrap Machine, and its constraints will be also be used for the model-level constraints. The connection to the controller will respect the given timeout parameter.
InitializeState returns the newly initialized state and bootstrap machine. If it fails, the state may well be irredeemably compromised.
Types ¶
type BootstrapMachineConfig ¶
type BootstrapMachineConfig struct { // Addresses holds the bootstrap machine's addresses. Addresses []network.Address // BootstrapConstraints holds the bootstrap machine's constraints. BootstrapConstraints constraints.Value // ModelConstraints holds the model-level constraints. ModelConstraints constraints.Value // Jobs holds the jobs that the machine agent will run. Jobs []multiwatcher.MachineJob // InstanceId holds the instance id of the bootstrap machine. InstanceId instance.Id // Characteristics holds hardware information on the // bootstrap machine. Characteristics instance.HardwareCharacteristics SharedSecret string }
BootstrapMachineConfig holds configuration information to attach to the bootstrap machine.