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

Constants

const (
    ControllerIPLeafGroup = "controllerip"
)

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run a pki Authority.

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
    Authority          pki.Authority
    APIHostPortsGetter APIHostPortsGetter
}

Config holds the configuration for the certificate updater worker.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName                string
    AuthorityName            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() (controller.StateServingInfo, bool)
}

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

Package certupdater imports 13 packages (graph) and is imported by 38 packages. Updated 2020-05-01. Refresh now. Tools for package owners.