upgradesteps

package
v0.0.0-...-e653fdf Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 21 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PerformUpgrade = upgrades.PerformUpgrade

	// UpgradeStartTimeoutController the maximum time a controller will
	// wait for other controllers to come up and indicate they are ready
	// to begin running upgrade steps.
	UpgradeStartTimeoutController = time.Minute * 15
)

TODO (manadart 2021-05-18): These are exported for tests and in the case of the timeout, for feature tests. That especially should be a dependency of the worker.

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 NewLock

func NewLock(agentConfig agent.Config) gate.Lock

NewLock creates a gate.Lock to be used to synchronise workers which need to start after upgrades have completed. The returned Lock should be passed to NewWorker. If the agent has already upgraded to the current version, then the lock will be returned in the released state.

func NewWorker

func NewWorker(
	upgradeComplete gate.Lock,
	agent agent.Agent,
	apiConn api.Connection,
	isController bool,
	openState func() (*state.StatePool, error),
	preUpgradeSteps upgrades.PreUpgradeStepsFunc,
	retryStrategy retry.CallArgs,
	entity StatusSetter,
	isCaas bool,
) (worker.Worker, error)

NewWorker returns a new instance of the upgradeSteps worker. It will run any required steps to upgrade to the currently running Juju version.

Types

type ManifoldConfig

type ManifoldConfig struct {
	AgentName            string
	APICallerName        string
	UpgradeStepsGateName string
	OpenStateForUpgrade  func() (*state.StatePool, error)
	PreUpgradeSteps      upgrades.PreUpgradeStepsFunc
	NewAgentStatusSetter func(apiConn api.Connection) (StatusSetter, error)
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

type StatusSetter

type StatusSetter interface {
	SetStatus(setableStatus status.Status, info string, data map[string]interface{}) error
}

StatusSetter defines the single method required to set an agent's status.

Jump to

Keyboard shortcuts

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