certupdater

package
v0.0.0-...-c3d9892 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

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

func NewCertificateUpdater

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

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.

Types

type APIHostPortsGetter

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

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

type AddressWatcher

type AddressWatcher interface {
	WatchAddresses() watcher.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

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

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

type CertificateUpdater

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

func (c *CertificateUpdater) Handle(_ context.Context) error

Handle is defined on the NotifyWatchHandler interface.

func (*CertificateUpdater) SetUp

SetUp is defined on the NotifyWatchHandler interface.

func (*CertificateUpdater) TearDown

func (c *CertificateUpdater) TearDown() error

TearDown is defined on the NotifyWatchHandler interface.

type Config

type Config struct {
	AddressWatcher         AddressWatcher
	Authority              pki.Authority
	APIHostPortsGetter     APIHostPortsGetter
	ControllerConfigGetter ControllerConfigGetter
	Logger                 logger.Logger
}

Config holds the configuration for the certificate updater worker.

type ControllerConfigGetter

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

ControllerConfigGetter is an interface that returns the controller config.

type ManifoldConfig

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

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

func (ManifoldConfig) Validate

func (config ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type StateServingInfoGetter

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL