Documentation
¶
Index ¶
- Constants
- Variables
- func Bootstrap(ctx environs.BootstrapContext, environ environs.Environ, ...) error
- func CreateStateFile(stor storage.Storage) (string, error)
- func DeleteStateFile(stor storage.Storage) error
- func EnsureNotBootstrapped(env environs.Environ) error
- func EnsureToolsAvailability(ctx environs.BootstrapContext, env environs.Environ, series string, ...) (coretools.List, error)
- func SaveState(storage storage.StorageWriter, state *BootstrapState) error
- func SeriesToUpload(cfg *config.Config, series []string) []string
- func SetBootstrapTools(environ environs.Environ, possibleTools coretools.List) (coretools.List, error)
- func UploadTools(ctx environs.BootstrapContext, env environs.Environ, toolsArch *string, ...) error
- type BootstrapState
Constants ¶
const StateFile = "provider-state"
StateFile is the name of the file where the provider's state is stored.
Variables ¶
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 ¶
func Bootstrap(ctx environs.BootstrapContext, environ environs.Environ, args environs.BootstrapParams) error
Bootstrap bootstraps the given environment. The supplied constraints are used to provision the instance, and are also set within the bootstrapped environment.
func CreateStateFile ¶
CreateStateFile creates an empty state file on the given storage, and returns its URL.
func DeleteStateFile ¶
DeleteStateFile deletes the state file on the given storage.
func EnsureNotBootstrapped ¶
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 ¶
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.