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

package deployer

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

Index

Package Files

deployer.go manifold.go simple.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs a deployer worker, using the resource names defined in the supplied config.

func NewDeployer Uses

func NewDeployer(st *apideployer.State, ctx Context) (worker.Worker, error)

NewDeployer returns a Worker that deploys and recalls unit agents via ctx, taking a machine id to operate on.

type APICalls Uses

type APICalls interface {
    ConnectionInfo() (params.DeployerConnectionValues, error)
}

APICalls defines the interface to the API that the simple context needs.

type Context Uses

type Context interface {
    // DeployUnit causes the agent for the specified unit to be started and run
    // continuously until further notice without further intervention. It will
    // return an error if the agent is already deployed.
    DeployUnit(unitName, initialPassword string) error

    // RecallUnit causes the agent for the specified unit to be stopped, and
    // the agent's data to be destroyed. It will return an error if the agent
    // was not deployed by the manager.
    RecallUnit(unitName string) error

    // DeployedUnits returns the names of all units deployed by the manager.
    DeployedUnits() ([]string, error)

    // AgentConfig returns the agent config for the machine agent that is
    // running the deployer.
    AgentConfig() agent.Config
}

Context abstracts away the differences between different unit deployment strategies; where a Deployer is responsible for what to deploy, a Context is responsible for how to deploy.

type Deployer Uses

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

Deployer is responsible for deploying and recalling unit agents, according to changes in a set of state units; and for the final removal of its agents' units from state when they are no longer needed.

func (*Deployer) Handle Uses

func (d *Deployer) Handle(_ <-chan struct{}, unitNames []string) error

func (*Deployer) SetUp Uses

func (d *Deployer) SetUp() (watcher.StringsWatcher, error)

func (*Deployer) TearDown Uses

func (d *Deployer) TearDown() error

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName        string
    APICallerName    string
    NewDeployContext func(st *apideployer.State, agentConfig agent.Config) Context
}

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

type SimpleContext Uses

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

SimpleContext is a Context that manages unit deployments on the local system.

func NewSimpleContext Uses

func NewSimpleContext(agentConfig agent.Config, api APICalls) *SimpleContext

NewSimpleContext returns a new SimpleContext, acting on behalf of the specified deployer, that deploys unit agents. Paths to which agents and tools are installed are relative to dataDir.

func (*SimpleContext) AgentConfig Uses

func (ctx *SimpleContext) AgentConfig() agent.Config

func (*SimpleContext) DeployUnit Uses

func (ctx *SimpleContext) DeployUnit(unitName, initialPassword string) (err error)

func (*SimpleContext) DeployedUnits Uses

func (ctx *SimpleContext) DeployedUnits() ([]string, error)

func (*SimpleContext) RecallUnit Uses

func (ctx *SimpleContext) RecallUnit(unitName string) error

Package deployer imports 26 packages (graph) and is imported by 69 packages. Updated 2019-11-14. Refresh now. Tools for package owners.