Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedTargetVersion ¶
AllowedTargetVersion checks if targetVersion is too different from curVersion to allow a downgrade.
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 Config ¶
type Config struct {
Clock Clock
Logger Logger
State *upgrader.State
AgentConfig agent.Config
OrigAgentVersion version.Number
UpgradeStepsWaiter gate.Waiter
InitialUpgradeCheckComplete gate.Unlocker
CheckDiskSpace func(string, uint64) error
}
Config contains the items the worker needs to start.
type Logger ¶
type Logger interface {
Debugf(string, ...interface{})
Infof(string, ...interface{})
Errorf(string, ...interface{})
}
Logger represents the logging methods used by this package.
type ManifoldConfig ¶
type ManifoldConfig struct {
AgentName string
APICallerName string
UpgradeStepsGateName string
UpgradeCheckGateName string
PreviousAgentVersion version.Number
Logger Logger
Clock Clock
}
ManifoldConfig defines the names of the manifolds on which a Manifold will depend.
type Upgrader ¶
type Upgrader struct {
// contains filtered or unexported fields
}
Upgrader represents a worker that watches the state for upgrade requests.
func NewAgentUpgrader ¶
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.