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

package instancemutater

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

Index

Package Files

manifold.go mutater.go shim.go worker.go

func BrokerAPIManifold Uses

func BrokerAPIManifold(config BrokerAPIConfig, start BrokerAPIStartFunc) dependency.Manifold

BrokerAPIManifold returns a dependency.Manifold that calls the supplied start func with the API and envrion resources defined in the config (once those resources are present).

func EnvironAPIManifold Uses

func EnvironAPIManifold(config EnvironAPIConfig, start EnvironAPIStartFunc) dependency.Manifold

EnvironAPIManifold returns a dependency.Manifold that calls the supplied start func with the API and envrion resources defined in the config (once those resources are present).

func MachineManifold Uses

func MachineManifold(config MachineManifoldConfig) dependency.Manifold

MachineManifold returns a Manifold that encapsulates the instancemutater worker.

func ModelManifold Uses

func ModelManifold(config ModelManifoldConfig) dependency.Manifold

ModelManifold returns a Manifold that encapsulates the instancemutater worker.

func NewContainerWorker Uses

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

NewContainerWorker returns a worker that keeps track of the containers in the state for this machine agent and polls their instance for addition or removal changes.

func NewEnvironWorker Uses

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

NewEnvironWorker returns a worker that keeps track of the machines in the state and polls their instance for addition or removal changes.

type BrokerAPIConfig Uses

type BrokerAPIConfig struct {
    BrokerName    string
    APICallerName string
    AgentName     string
}

BrokerAPIConfig represents a typed manifold starter func, that handles getting resources from the configuration.

type BrokerAPIStartFunc Uses

type BrokerAPIStartFunc func(environs.InstanceBroker, base.APICaller, agent.Agent) (worker.Worker, error)

BrokerAPIStartFunc encapsulates creation of a worker based on the environ and APICaller.

type Config Uses

type Config struct {
    Facade InstanceMutaterAPI

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

    Broker environs.LXDProfiler

    AgentConfig agent.Config

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

    // GetMachineWatcher allows the worker to watch different "machines"
    // depending on whether this work is running with an environ broker
    // or a container broker.
    GetMachineWatcher func() (watcher.StringsWatcher, error)

    // GetRequiredLXPprofiles provides a slice of strings representing the
    // lxd profiles to be included on every LXD machine used given the
    // current model name.
    GetRequiredLXDProfiles RequiredLXDProfilesFunc

    // GetRequiredContext provides a way to override the given context
    // Note: the following is required for testing purposes when we have an
    // error case and we want to know when it's valid to kill/clean the worker.
    GetRequiredContext RequiredMutaterContextFunc
}

Config represents the configuration required to run a new instance machineApi worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate checks for missing values from the configuration and checks that they conform to a given type.

type EnvironAPIConfig Uses

type EnvironAPIConfig struct {
    EnvironName   string
    APICallerName string
    AgentName     string
}

EnvironAPIConfig represents a typed manifold starter func, that handles getting resources from the configuration.

type EnvironAPIStartFunc Uses

type EnvironAPIStartFunc func(environs.Environ, base.APICaller, agent.Agent) (worker.Worker, error)

EnvironAPIStartFunc encapsulates creation of a worker based on the environ and APICaller.

type InstanceMutaterAPI Uses

type InstanceMutaterAPI interface {
    WatchMachines() (watcher.StringsWatcher, error)
    Machine(tag names.MachineTag) (instancemutater.MutaterMachine, error)
}

func NewClient Uses

func NewClient(apiCaller base.APICaller) InstanceMutaterAPI

type Logger Uses

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

Logger represents the logging methods called.

type MachineContext Uses

type MachineContext interface {
    // contains filtered or unexported methods
}

type MachineManifoldConfig Uses

type MachineManifoldConfig struct {
    APICallerName string
    BrokerName    string
    AgentName     string

    Logger    Logger
    NewWorker func(Config) (worker.Worker, error)
    NewClient func(base.APICaller) InstanceMutaterAPI
}

MachineManifoldConfig describes the resources used by the instancemuter worker.

func (MachineManifoldConfig) Validate Uses

func (config MachineManifoldConfig) Validate() error

Validate validates the manifold configuration.

type ModelManifoldConfig Uses

type ModelManifoldConfig struct {
    APICallerName string
    EnvironName   string
    AgentName     string

    Logger    Logger
    NewWorker func(Config) (worker.Worker, error)
    NewClient func(base.APICaller) InstanceMutaterAPI
}

ModelManifoldConfig describes the resources used by the instancemuter worker.

func (ModelManifoldConfig) Validate Uses

func (config ModelManifoldConfig) Validate() error

Validate validates the manifold configuration.

type MutaterContext Uses

type MutaterContext interface {
    MachineContext
    // contains filtered or unexported methods
}

type MutaterMachine Uses

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

type RequiredLXDProfilesFunc Uses

type RequiredLXDProfilesFunc func(string) []string

type RequiredMutaterContextFunc Uses

type RequiredMutaterContextFunc func(MutaterContext) MutaterContext

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.

Package instancemutater imports 18 packages (graph) and is imported by 6 packages. Updated 2019-12-06. Refresh now. Tools for package owners.