juju: github.com/juju/juju/worker/upgrader Index | Files

package upgrader

import "github.com/juju/juju/worker/upgrader"

Index

Package Files

manifold.go upgrader.go

func AllowedTargetVersion Uses

func AllowedTargetVersion(
    origAgentVersion version.Number,
    curVersion version.Number,
    targetVersion version.Number,
) bool

AllowedTargetVersion checks if targetVersion is too different from curVersion to allow a downgrade.

func Manifold Uses

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.

type Clock Uses

type Clock interface {
    After(time.Duration) <-chan time.Time
}

Clock represents the clock methods this worker uses.

type Config Uses

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 Uses

type Logger interface {
    Debugf(string, ...interface{})
    Infof(string, ...interface{})
    Errorf(string, ...interface{})
}

Logger represents the logging methods used by this package.

type ManifoldConfig Uses

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 Uses

type Upgrader struct {
    // contains filtered or unexported fields
}

Upgrader represents a worker that watches the state for upgrade requests.

func NewAgentUpgrader Uses

func NewAgentUpgrader(config Config) (*Upgrader, error)

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.

func (*Upgrader) Kill Uses

func (u *Upgrader) Kill()

Kill implements worker.Worker.Kill.

func (*Upgrader) Wait Uses

func (u *Upgrader) Wait() error

Wait implements worker.Worker.Wait.

Package upgrader imports 23 packages (graph) and is imported by 165 packages. Updated 2020-08-04. Refresh now. Tools for package owners.