bootstrap

package
v0.0.0-...-6337964 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2014 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const StateFile = "provider-state"

StateFile is the name of the file where the provider's state is stored.

Variables

View Source
var ToolsLtsSeries = []string{"precise", "trusty"}

Unless otherwise specified, we will upload tools for all lts series on bootstrap when --upload-tools is used. ToolsLtsSeries records the known lts series.

Functions

func Bootstrap

Bootstrap bootstraps the given environment. The supplied constraints are used to provision the instance, and are also set within the bootstrapped environment.

func CreateStateFile

func CreateStateFile(stor storage.Storage) (string, error)

CreateStateFile creates an empty state file on the given storage, and returns its URL.

func DeleteStateFile

func DeleteStateFile(stor storage.Storage) error

DeleteStateFile deletes the state file on the given storage.

func EnsureNotBootstrapped

func EnsureNotBootstrapped(env environs.Environ) error

EnsureNotBootstrapped returns nil if the environment is not bootstrapped, and an error if it is or if the function was not able to tell.

func EnsureToolsAvailability

func EnsureToolsAvailability(ctx environs.BootstrapContext, env environs.Environ, series string, toolsArch *string) (coretools.List, error)

EnsureToolsAvailability verifies the tools are available. If no tools are found, it will automatically synchronize them.

func SaveState

func SaveState(storage storage.StorageWriter, state *BootstrapState) error

SaveState writes the given state to the given storage.

func SeriesToUpload

func SeriesToUpload(cfg *config.Config, series []string) []string

SeriesToUpload returns the supplied series with duplicates removed if non-empty; otherwise it returns a default list of series we should probably upload, based on cfg.

func SetBootstrapTools

func SetBootstrapTools(environ environs.Environ, possibleTools coretools.List) (coretools.List, error)

SetBootstrapTools returns the newest tools from the given tools list, and updates the agent-version configuration attribute.

func UploadTools

func UploadTools(ctx environs.BootstrapContext, env environs.Environ, toolsArch *string, forceVersion bool, bootstrapSeries ...string) error

UploadTools uploads tools for the specified series and any other relevant series to the environment storage, after which it sets the agent-version. If forceVersion is true, we allow uploading even when the agent-version is already set in the environment.

Types

type BootstrapState

type BootstrapState struct {
	// StateInstances are the state servers.
	StateInstances []instance.Id `yaml:"state-instances"`
}

BootstrapState is the state information that is stored in StateFile.

Individual providers may define their own state structures instead of this one, and use their own code for loading and saving those, but this is the definition that most practically useful providers share unchanged.

func LoadState

func LoadState(stor storage.StorageReader) (*BootstrapState, error)

LoadState reads state from the given storage.

Jump to

Keyboard shortcuts

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