upgradesteps

package
v0.0.0-...-b9bb202 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

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

ControllerWorkerFunc defines a function that returns a worker.Worker which runs the upgrade steps for a controller.

type MachineWorkerFunc

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL