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

package caasunitprovisioner

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

Index

Package Files

application_worker.go broker.go client.go deployment_worker.go manifold.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold creates a manifold that runs a CAAS unit provisioner. See the ManifoldConfig type for discussion about how this can/should evolve.

func NewWorker Uses

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

NewWorker starts and returns a new CAAS unit provisioner worker.

type ApplicationGetter Uses

type ApplicationGetter interface {
    WatchApplications() (watcher.StringsWatcher, error)
    ApplicationConfig(string) (application.ConfigAttributes, error)
    WatchApplicationScale(string) (watcher.NotifyWatcher, error)
    ApplicationScale(string) (int, error)
}

ApplicationGetter provides an interface for watching for the lifecycle state changes (including addition) of applications in the model, and fetching their details.

type ApplicationUpdater Uses

type ApplicationUpdater interface {
    UpdateApplicationService(arg params.UpdateApplicationServiceArg) error
}

ApplicationUpdater provides an interface for updating Juju applications from changes in the cloud.

type Client Uses

type Client interface {
    ApplicationGetter
    ApplicationUpdater
    ProvisioningInfoGetter
    LifeGetter
    UnitUpdater
    ProvisioningStatusSetter
}

Client provides an interface for interacting with the CAASUnitProvisioner API. Subsets of this should be passed to the CAASUnitProvisioner worker.

type Config Uses

type Config struct {
    ApplicationGetter  ApplicationGetter
    ApplicationUpdater ApplicationUpdater
    ServiceBroker      ServiceBroker

    ContainerBroker          ContainerBroker
    ProvisioningInfoGetter   ProvisioningInfoGetter
    ProvisioningStatusSetter ProvisioningStatusSetter
    LifeGetter               LifeGetter
    UnitUpdater              UnitUpdater
}

Config holds configuration for the CAAS unit provisioner worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate validates the worker configuration.

type ContainerBroker Uses

type ContainerBroker interface {
    Provider() caas.ContainerEnvironProvider
    WatchUnits(appName string) (watcher.NotifyWatcher, error)
    Units(appName string) ([]caas.Unit, error)
    WatchOperator(string) (watcher.NotifyWatcher, error)
    Operator(string) (*caas.Operator, error)
}

type LifeGetter Uses

type LifeGetter interface {
    Life(string) (life.Value, error)
}

LifeGetter provides an interface for getting the lifecycle state value for an application or unit.

type ManifoldConfig Uses

type ManifoldConfig struct {
    APICallerName string
    BrokerName    string

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

ManifoldConfig defines a CAAS unit provisioner's dependencies.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Validate is called by start to check for bad configuration.

type ProvisioningInfoGetter Uses

type ProvisioningInfoGetter interface {
    ProvisioningInfo(appName string) (*apicaasunitprovisioner.ProvisioningInfo, error)
    WatchPodSpec(appName string) (watcher.NotifyWatcher, error)
}

ProvisioningInfoGetter provides an interface for watching and getting the pod spec and other info needed to provision an application.

type ProvisioningStatusSetter Uses

type ProvisioningStatusSetter interface {
    // SetOperatorStatus sets the status for the application operator.
    SetOperatorStatus(appName string, status status.Status, message string, data map[string]interface{}) error
}

ProvisioningStatusSetter provides an interface for setting status information.

type ServiceBroker Uses

type ServiceBroker interface {
    Provider() caas.ContainerEnvironProvider
    EnsureService(appName string, statusCallback caas.StatusCallbackFunc, params *caas.ServiceParams, numUnits int, config application.ConfigAttributes) error
    GetService(appName string, includeClusterIP bool) (*caas.Service, error)
    DeleteService(appName string) error
    UnexposeService(appName string) error
    WatchService(appName string) (watcher.NotifyWatcher, error)
}

type UnitUpdater Uses

type UnitUpdater interface {
    UpdateUnits(arg params.UpdateApplicationUnits) error
}

UnitUpdater provides an interface for updating Juju units from changes in the cloud.

Package caasunitprovisioner imports 19 packages (graph) and is imported by 3 packages. Updated 2019-09-24. Refresh now. Tools for package owners.