Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentBootstrap ¶
type AgentBootstrap struct {
// contains filtered or unexported fields
}
AgentBootstrap is used to initialize the state for a new controller.
func NewAgentBootstrap ¶
func NewAgentBootstrap(args AgentBootstrapArgs) (*AgentBootstrap, error)
NewAgentBootstrap creates a new AgentBootstrap, that can be used to initialize the state for a new controller. NewAgentBootstrap should be called with 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 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.
func (*AgentBootstrap) Initialize ¶
func (b *AgentBootstrap) Initialize(ctx context.Context) (_ *state.Controller, resultErr error)
Initialize returns the newly initialized state and bootstrap machine. If it fails, the state may well be irredeemably compromised. TODO (stickupkid): Split this function into testable smaller functions.
type AgentBootstrapArgs ¶
type AgentBootstrapArgs struct { AdminUser names.UserTag AgentConfig agent.ConfigSetter BootstrapEnviron environs.BootstrapEnviron BootstrapMachineAddresses corenetwork.ProviderAddresses BootstrapMachineJobs []model.MachineJob MongoDialOpts mongo.DialOpts StateInitializationParams instancecfg.StateInitializationParams StorageProviderRegistry storage.ProviderRegistry BootstrapDqlite DqliteInitializerFunc Provider ProviderFunc Logger logger.Logger }
AgentBootstrapArgs are the arguments to NewAgentBootstrap that are required to NewAgentBootstrap.
type DqliteInitializerFunc ¶
type DqliteInitializerFunc func( ctx context.Context, mgr database.BootstrapNodeManager, modelUUID model.UUID, logger logger.Logger, options ...database.BootstrapOpt, ) error
DqliteInitializerFunc is a function that initializes the dqlite database for the controller.
type ProviderFunc ¶
type ProviderFunc func(string) (environs.EnvironProvider, error)
ProviderFunc is a function that returns an EnvironProvider.