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.
func NewControllerWorker ¶
func NewControllerWorker( upgradeCompleteLock gate.Lock, agent agent.Agent, apiCaller base.APICaller, upgradeService UpgradeService, preUpgradeSteps upgrades.PreUpgradeStepsFunc, performUpgradeSteps upgrades.UpgradeStepsFunc, entity upgradesteps.StatusSetter, logger logger.Logger, clock clock.Clock, ) (worker.Worker, error)
NewControllerWorker returns a new instance of the controllerWorker worker. It will run any required steps to upgrade to the currently running Juju version.
Types ¶
type ControllerWorkerFunc ¶
type ControllerWorkerFunc func( gate.Lock, agent.Agent, base.APICaller, UpgradeService, upgrades.PreUpgradeStepsFunc, upgrades.UpgradeStepsFunc, upgradesteps.StatusSetter, logger.Logger, clock.Clock, ) (worker.Worker, error)
ControllerWorkerFunc defines a function that returns a worker.Worker which runs the upgrade steps for a controller.
type MachineWorkerFunc ¶
type MachineWorkerFunc func( gate.Lock, agent.Agent, base.APICaller, upgrades.PreUpgradeStepsFunc, upgrades.UpgradeStepsFunc, upgradesteps.StatusSetter, logger.Logger, clock.Clock, ) worker.Worker
MachineWorkerFunc defines a function that returns a worker.Worker which runs the upgrade steps for a machine.
type ManifoldConfig ¶
type ManifoldConfig struct { AgentName string APICallerName string UpgradeStepsGateName string DomainServicesName string PreUpgradeSteps upgrades.PreUpgradeStepsFunc UpgradeSteps upgrades.UpgradeStepsFunc NewAgentStatusSetter func(context.Context, base.APICaller) (upgradesteps.StatusSetter, error) NewMachineWorker MachineWorkerFunc NewControllerWorker ControllerWorkerFunc Logger logger.Logger Clock clock.Clock }
ManifoldConfig defines the names of the manifolds on which a Manifold will depend.
func (ManifoldConfig) Validate ¶
func (c ManifoldConfig) Validate() error
Validate checks that the config is valid.
type UpgradeService ¶
type UpgradeService interface { // SetControllerDone marks the supplied controllerID as having // completed its upgrades. When SetControllerDone is called by the // last provisioned controller, the upgrade will be archived. SetControllerDone(ctx context.Context, upgradeUUID domainupgrade.UUID, controllerID string) error // SetDBUpgradeFailed marks the upgrade as failed in the database. // Manual intervention will be required if this has been invoked. SetDBUpgradeFailed(ctx context.Context, upgradeUUID domainupgrade.UUID) error // ActiveUpgrade returns the uuid of the current active upgrade. If there // are no active upgrades, return an upgradeerrors.NotFound error. ActiveUpgrade(ctx context.Context) (domainupgrade.UUID, error) // UpgradeInfo returns the upgrade info for the supplied upgradeUUID. If // there are no active upgrades, return an upgradeerrors.NotFound error. UpgradeInfo(ctx context.Context, upgradeUUID domainupgrade.UUID) (upgrade.Info, error) // WatchForUpgradeState creates a watcher which notifies when the upgrade // has reached the given state. WatchForUpgradeState(ctx context.Context, upgradeUUID domainupgrade.UUID, state upgrade.State) (watcher.NotifyWatcher, error) }
UpgradeService is the interface for the upgrade service.