juju: github.com/juju/juju/worker/upgradeseries Index | Files | Directories

package upgradeseries

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


Package Files

manifold.go service.go shim.go upgrader.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs an upgrade-series worker, using the resource names defined in the supplied config.

func NewWorker Uses

func NewWorker(config Config) (worker.Worker, error)

NewWorker creates, starts and returns a new upgrade-series worker based on the input configuration.

type AgentService Uses

type AgentService interface {
    Running() (bool, error)
    Start() error
    Stop() error

AgentService is a service managed by the local init system, for running a unit agent.

type Config Uses

type Config struct {
    // FacadeFactory is used to acquire back-end state with
    // the input tag context.
    FacadeFactory func(names.Tag) Facade

    // Logger is the logger for this worker.
    Logger Logger

    // Tag is the current machine tag.
    Tag names.Tag

    // ServiceAccess provides access to the local init system.
    Service ServiceAccess

    // UpgraderFactory is a factory method that will return an upgrader capable
    // of handling service and agent binary manipulation for a
    // runtime-determined target OS series.
    UpgraderFactory func(string) (Upgrader, error)

Config is the configuration needed to construct an UpgradeSeries worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate validates the upgrade-series worker configuration.

type Facade Uses

type Facade interface {
    // Getters
    WatchUpgradeSeriesNotifications() (watcher.NotifyWatcher, error)
    MachineStatus() (model.UpgradeSeriesStatus, error)
    UnitsPrepared() ([]names.UnitTag, error)
    UnitsCompleted() ([]names.UnitTag, error)
    TargetSeries() (string, error)

    // Setters
    StartUnitCompletion(reason string) error
    SetMachineStatus(status model.UpgradeSeriesStatus, reason string) error
    FinishUpgradeSeries(string) error
    PinMachineApplications() (map[string]error, error)
    UnpinMachineApplications() (map[string]error, error)

Facade exposes the API surface required by the upgrade-series worker.

func NewFacade Uses

func NewFacade(apiCaller base.APICaller, tag names.Tag) Facade

NewFacade creates a *upgradeseries.Client and returns it as a Facade.

type Logger Uses

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

Logger represents the methods required to emit log messages.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName     string
    APICallerName string

    Logger    Logger
    NewFacade func(base.APICaller, names.Tag) Facade
    NewWorker func(Config) (worker.Worker, error)

ManifoldConfig holds the information necessary for the dependency engine to to run an upgrade-series worker.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type ServiceAccess Uses

type ServiceAccess interface {
    // ListServices returns a slice of service
    // names known by the local init system.
    ListServices() ([]string, error)

    // DiscoverService returns a service implementation
    // based on the input service name and config.
    DiscoverService(string) (AgentService, error)

ServiceAccess describes methods for interacting with the local init system.

type Upgrader Uses

type Upgrader interface {
    PerformUpgrade() error

Upgrader describes methods required to perform file-system manipulation in preparation for upgrading the host Ubuntu version.

func NewUpgrader Uses

func NewUpgrader(toSeries string, manager service.SystemdServiceManager, logger Logger) (Upgrader, error)

NewUpgrader uses the input function to determine the series that should be supported, and returns a reference to a new Upgrader that supports it.


mocksPackage mocks is a generated GoMock package.

Package upgradeseries imports 20 packages (graph) and is imported by 6 packages. Updated 2019-09-17. Refresh now. Tools for package owners.