juju: github.com/juju/juju/cmd/jujud/agent/caasoperator Index | Files

package caasoperator

import "github.com/juju/juju/cmd/jujud/agent/caasoperator"


Package Files


func Manifolds Uses

func Manifolds(config ManifoldsConfig) dependency.Manifolds

Manifolds returns a set of co-configured manifolds covering the various responsibilities of a caasoperator agent. It also accepts the logSource argument because we haven't figured out how to thread all the logging bits through a dependency engine yet.

Thou Shalt Not Use String Literals In This Function. Or Else.

type ManifoldsConfig Uses

type ManifoldsConfig struct {

    // Agent contains the agent that will be wrapped and made available to
    // its dependencies via a dependency.Engine.
    Agent coreagent.Agent

    // AgentConfigChanged is set whenever the unit agent's config
    // is updated.
    AgentConfigChanged *voyeur.Value

    // Clock contains the clock that will be made available to manifolds.
    Clock clock.Clock

    // LogSource will be read from by the logsender component.
    LogSource logsender.LogRecordCh

    // UpdateLoggerConfig is a function that will save the specified
    // config value as the logging config in the agent.conf file.
    UpdateLoggerConfig func(string) error

    // PrometheusRegisterer is a prometheus.Registerer that may be used
    // by workers to register Prometheus metric collectors.
    PrometheusRegisterer prometheus.Registerer

    // LeadershipGuarantee controls the behaviour of the leadership tracker.
    LeadershipGuarantee time.Duration

    // ValidateMigration is called by the migrationminion during the
    // migration process to check that the agent will be ok when
    // connected to the new target controller.
    ValidateMigration func(base.APICaller) error

    // UpgradeStepsLock is passed to the upgrade steps gate to
    // coordinate workers that shouldn't do anything until the
    // upgrade-steps worker is done.
    UpgradeStepsLock gate.Lock

    // PreUpgradeSteps is a function that is used by the upgradesteps
    // worker to ensure that conditions are OK for an upgrade to
    // proceed.
    PreUpgradeSteps func(*state.StatePool, coreagent.Config, bool, bool, bool) error

    // MachineLock is a central source for acquiring the machine lock.
    // This is used by a number of workers to ensure serialisation of actions
    // across the machine.
    MachineLock machinelock.Lock

    // PreviousAgentVersion passes through the version the unit
    // agent was running before the current restart.
    PreviousAgentVersion version.Number

    // NewExecClient provides k8s execframework functionality for juju run commands or actions.
    NewExecClient func(namespace string) (exec.Executor, error)

    // NewContainerStartWatcherClient provides the container start watcher client.
    NewContainerStartWatcherClient func(caasoperator.Client) caasoperator.ContainerStartWatcher

    // RunListenerSocket returns a function to create a run listener socket.
    RunListenerSocket func(*uniter.SocketConfig) (*sockets.Socket, error)

ManifoldsConfig allows specialisation of the result of Manifolds.

Package caasoperator imports 37 packages (graph) and is imported by 6 packages. Updated 2020-04-25. Refresh now. Tools for package owners.