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

package certupdater

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

Index

Package Files

certupdater.go manifold.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run a certupdater.

func NewCertificateUpdater Uses

func NewCertificateUpdater(config Config) worker.Worker

NewCertificateUpdater returns a worker.Worker that watches for changes to machine addresses and then generates a new controller certificate with those addresses in the certificate's SAN value.

type APIHostPortsGetter Uses

type APIHostPortsGetter interface {
    APIHostPortsForClients() ([]network.SpaceHostPorts, error)
}

APIHostPortsGetter is an interface that is provided to NewCertificateUpdater. It returns all known API addresses.

type AddressWatcher Uses

type AddressWatcher interface {
    WatchAddresses() state.NotifyWatcher
    Addresses() (addresses network.SpaceAddresses)
}

AddressWatcher is an interface that is provided to NewCertificateUpdater which can be used to watch for machine address changes.

func NewMachineAddressWatcher Uses

func NewMachineAddressWatcher(st *state.State, machineId string) (AddressWatcher, error)

NewMachineAddressWatcher is the function that non-test code should pass into ManifoldConfig.NewMachineAddressWatcher.

type CertificateUpdater Uses

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

CertificateUpdater is responsible for generating controller certificates.

In practice, CertificateUpdater is used by a controller's machine agent to watch that server's machines addresses in state, and write a new certificate to the agent's config file.

func (*CertificateUpdater) Handle Uses

func (c *CertificateUpdater) Handle(done <-chan struct{}) error

Handle is defined on the NotifyWatchHandler interface.

func (*CertificateUpdater) SetUp Uses

func (c *CertificateUpdater) SetUp() (state.NotifyWatcher, error)

SetUp is defined on the NotifyWatchHandler interface.

func (*CertificateUpdater) TearDown Uses

func (c *CertificateUpdater) TearDown() error

TearDown is defined on the NotifyWatchHandler interface.

type Config Uses

type Config struct {
    AddressWatcher         AddressWatcher
    StateServingInfoGetter StateServingInfoGetter
    StateServingInfoSetter StateServingInfoSetter
    ControllerConfigGetter ControllerConfigGetter
    APIHostPortsGetter     APIHostPortsGetter
}

Config holds the configuration for the certificate updater worker.

type ControllerConfigGetter Uses

type ControllerConfigGetter interface {
    ControllerConfig() (controller.Config, error)
}

ControllerConfigGetter is an interface that is provided to NewCertificateUpdater which can be used to get the controller config.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName                string
    StateName                string
    NewWorker                func(Config) worker.Worker
    NewMachineAddressWatcher func(st *state.State, machineId string) (AddressWatcher, error)
}

ManifoldConfig holds the information necessary to run a certupdater in a dependency.Engine.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type StateServingInfoGetter Uses

type StateServingInfoGetter interface {
    StateServingInfo() (params.StateServingInfo, bool)
}

StateServingInfoGetter is an interface that is provided to NewCertificateUpdater whose StateServingInfo method will be invoked to get state serving info.

type StateServingInfoSetter Uses

type StateServingInfoSetter func(info params.StateServingInfo) error

StateServingInfoSetter defines a function that is called to set a StateServingInfo value with a newly generated certificate.

Package certupdater imports 15 packages (graph) and is imported by 35 packages. Updated 2019-10-05. Refresh now. Tools for package owners.