Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCertificateUpdater ¶
func NewCertificateUpdater(addressWatcher AddressWatcher, getter StateServingInfoGetter, configGetter ControllerConfigGetter, hostPortsGetter APIHostPortsGetter, setter StateServingInfoSetter, ) 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.
Types ¶
type APIHostPortsGetter ¶
APIHostPortsGetter is an interface that is provided to NewCertificateUpdater whose APIHostPorts method will be invoked to get controller addresses.
type AddressWatcher ¶
type AddressWatcher interface { WatchAddresses() state.NotifyWatcher Addresses() (addresses []network.Address) }
AddressWatcher is an interface that is provided to NewCertificateUpdater which can be used to watch for machine address changes.
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(done <-chan struct{}) error
Handle is defined on the NotifyWatchHandler interface.
func (*CertificateUpdater) SetUp ¶
func (c *CertificateUpdater) SetUp() (state.NotifyWatcher, error)
SetUp is defined on the NotifyWatchHandler interface.
func (*CertificateUpdater) TearDown ¶
func (c *CertificateUpdater) TearDown() error
TearDown is defined on the NotifyWatchHandler interface.
type ControllerConfigGetter ¶
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 StateServingInfoGetter ¶
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 ¶
type StateServingInfoSetter func(info params.StateServingInfo, done <-chan struct{}) error
StateServingInfoSetter defines a function that is called to set a StateServingInfo value with a newly generated certificate.