juju: github.com/juju/juju/agent/agentbootstrap Index | Files

package agentbootstrap

import "github.com/juju/juju/agent/agentbootstrap"

Index

Package Files

bootstrap.go

func InitializeState Uses

func InitializeState(
    env environs.BootstrapEnviron,
    adminUser names.UserTag,
    c agent.ConfigSetter,
    args InitializeStateParams,
    dialOpts mongo.DialOpts,
    newPolicy state.NewPolicyFunc,
) (_ *state.Controller, resultErr error)

InitializeState 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 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.

type InitializeStateParams Uses

type InitializeStateParams struct {
    instancecfg.StateInitializationParams

    // BootstrapMachineAddresses holds the bootstrap machine's addresses.
    BootstrapMachineAddresses corenetwork.ProviderAddresses

    // BootstrapMachineJobs holds the jobs that the bootstrap machine
    // agent will run.
    BootstrapMachineJobs []multiwatcher.MachineJob

    // SharedSecret is the Mongo replica set shared secret (keyfile).
    SharedSecret string

    // Provider is called to obtain an EnvironProvider.
    Provider func(string) (environs.EnvironProvider, error)

    // StorageProviderRegistry is used to determine and store the
    // details of the default storage pools.
    StorageProviderRegistry storage.ProviderRegistry
}

InitializeStateParams holds parameters used for initializing the state database.

Package agentbootstrap imports 28 packages (graph) and is imported by 21 packages. Updated 2019-10-11. Refresh now. Tools for package owners.