Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency manifold that runs an upgrader worker, using the resource names defined in the supplied config.
Types ¶
type ManifoldConfig ¶
type ManifoldConfig struct { AgentName string APICallerName string UpgradeStepsGateName string UpgradeCheckGateName string PreviousAgentVersion version.Number }
ManifoldConfig defines the names of the manifolds on which a Manifold will depend.
type UpgradeReadyError ¶
type UpgradeReadyError struct { AgentName string OldTools version.Binary NewTools version.Binary DataDir string }
UpgradeReadyError is returned by an Upgrader to report that an upgrade is ready to be performed and a restart is due.
func (*UpgradeReadyError) ChangeAgentTools ¶
func (e *UpgradeReadyError) ChangeAgentTools() error
ChangeAgentTools does the actual agent upgrade. It should be called just before an agent exits, so that it will restart running the new tools.
func (*UpgradeReadyError) Error ¶
func (e *UpgradeReadyError) Error() string
type Upgrader ¶
type Upgrader struct {
// contains filtered or unexported fields
}
Upgrader represents a worker that watches the state for upgrade requests.
func NewAgentUpgrader ¶
func NewAgentUpgrader( st *upgrader.State, agentConfig agent.Config, origAgentVersion version.Number, upgradeStepsWaiter gate.Waiter, initialUpgradeCheckComplete gate.Unlocker, ) (*Upgrader, error)
NewAgentUpgrader returns a new upgrader worker. It watches changes to the current version of the current agent (with the given tag) and tries to download the tools for any new version into the given data directory. If an upgrade is needed, the worker will exit with an UpgradeReadyError holding details of the requested upgrade. The tools will have been downloaded and unpacked.