Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 NewUpgrader ¶
NewUpgrader 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.