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

package migrationmaster

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

Index

Package Files

manifold.go shim.go worker.go

Variables

var (
    // ErrInactive is returned when the migration is no longer active
    // (probably aborted). In this case the migrationmaster should be
    // restarted so that it can wait for the next migration attempt.
    ErrInactive = errors.New("migration is no longer active")

    // ErrMigrated is returned when the model has migrated to another
    // server. The migrationmaster should not be restarted again in
    // this case.
    ErrMigrated = errors.New("model has migrated")
)

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold packages a Worker for use in a dependency.Engine.

func NewWorker Uses

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

NewWorker creates a new Worker from the config supplied.

type Config Uses

type Config struct {
    ModelUUID       string
    Facade          Facade
    Guard           fortress.Guard
    APIOpen         func(*api.Info, api.DialOpts) (api.Connection, error)
    UploadBinaries  func(migration.UploadBinariesConfig) error
    CharmDownloader migration.CharmDownloader
    ToolsDownloader migration.ToolsDownloader
    Clock           clock.Clock
}

Config defines the operation of a Worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate returns an error if config cannot drive a Worker.

type Facade Uses

type Facade interface {
    // Watch returns a watcher which reports when a migration is
    // active for the model associated with the API connection.
    Watch() (watcher.NotifyWatcher, error)

    // MigrationStatus returns the details and progress of the latest
    // model migration.
    MigrationStatus() (coremigration.MigrationStatus, error)

    // SetPhase updates the phase of the currently active model
    // migration.
    SetPhase(coremigration.Phase) error

    // SetStatusMessage sets a human readable message regarding the
    // progress of a migration.
    SetStatusMessage(string) error

    // Prechecks performs pre-migration checks on the model and
    // (source) controller.
    Prechecks() error

    // ModelInfo return basic information about the model to migrated.
    ModelInfo() (coremigration.ModelInfo, error)

    // Export returns a serialized representation of the model
    // associated with the API connection.
    Export() (coremigration.SerializedModel, error)

    // ProcessRelations runs a series of processes to ensure that the relations
    // of a given model are correct after a migrated model.
    ProcessRelations(string) error

    // OpenResource downloads a single resource for an application.
    OpenResource(string, string) (io.ReadCloser, error)

    // Reap removes all documents of the model associated with the API
    // connection.
    Reap() error

    // WatchMinionReports returns a watcher which reports when a migration
    // minion has made a report for the current migration phase.
    WatchMinionReports() (watcher.NotifyWatcher, error)

    // MinionReports returns details of the reports made by migration
    // minions to the controller for the current migration phase.
    MinionReports() (coremigration.MinionReports, error)

    // StreamModelLog takes a starting time and returns a channel that
    // will yield the logs on or after that time - these are the logs
    // that need to be transferred to the target after the migration
    // is successful.
    StreamModelLog(time.Time) (<-chan common.LogMessage, error)
}

Facade exposes controller functionality to a Worker.

func NewFacade Uses

func NewFacade(apiCaller base.APICaller) (Facade, error)

NewFacade attempts to create a new facade for the migration master

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName     string
    APICallerName string
    FortressName  string

    Clock     clock.Clock
    NewFacade func(base.APICaller) (Facade, error)
    NewWorker func(Config) (worker.Worker, error)
}

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

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Validate is called by start to check for bad configuration.

type Worker Uses

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

Worker waits until a migration is active and its configured Fortress is locked down, and then orchestrates a model migration.

func New Uses

func New(config Config) (*Worker, error)

New returns a Worker backed by config, or an error.

func (*Worker) Kill Uses

func (w *Worker) Kill()

Kill implements worker.Worker.

func (*Worker) Wait Uses

func (w *Worker) Wait() error

Wait implements worker.Worker.

Package migrationmaster imports 28 packages (graph) and is imported by 40 packages. Updated 2019-11-29. Refresh now. Tools for package owners.