agentbootstrap

package
v0.0.0-...-f88c608 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 46 Imported by: 5

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
	SharedSecret              string
	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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL