Documentation ¶
Overview ¶
The upgrades package provides infrastructure to upgrade previous Juju deployments to the current Juju version. The upgrade is performed on a per node basis, across all of the running Juju machines.
Important exported APIs include:
PerformUpgrade, which is invoked on each node by the machine agent with: fromVersion - the Juju version from which the upgrade is occurring target - the type of Juju node being upgraded context - provides API access to Juju state servers
Index ¶
Constants ¶
View Source
const ( // AllMachines applies to any machine. AllMachines = Target("allMachines") // HostMachine is a machine on which units are deployed. HostMachine = Target("hostMachine") // StateServer is a machine participating in a Juju state server cluster. StateServer = Target("stateServer") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context interface { // APIState returns an API connection to state. APIState() *api.State // State returns a connection to state. This will be non-nil // only in the context of a state server. State() *state.State // AgentConfig returns the agent config for the machine that is being // upgraded. AgentConfig() agent.Config }
Context is used give the upgrade steps attributes needed to do their job.
type Operation ¶
type Operation interface { // The Juju version for which this operation is applicable. // Upgrade operations designed for versions of Juju earlier // than we are upgrading from are not run since such steps would // already have been used to get to the version we are running now. TargetVersion() version.Number // Steps to perform during an upgrade. Steps() []Step }
Operation defines what steps to perform to upgrade to a target version.
type Step ¶
type Step interface { // Description is a human readable description of what the upgrade step does. Description() string // Targets returns the target machine types for which the upgrade step is applicable. Targets() []Target // Run executes the upgrade business logic. Run(context Context) error }
Step defines an idempotent operation that is run to perform a specific upgrade step.
Click to show internal directories.
Click to hide internal directories.