Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCertificateUpdater ¶
func NewCertificateUpdater(addressWatcher AddressWatcher, getter StateServingInfoGetter, configGetter EnvironConfigGetter, setter StateServingInfoSetter, certChanged chan params.StateServingInfo, ) worker.Worker
NewCertificateUpdater returns a worker.Worker that watches for changes to machine addresses and then generates a new state server certificate with those addresses in the certificate's SAN value.
Types ¶
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 state server certificates.
In practice, CertificateUpdater is used by a state server'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() (watcher.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 EnvironConfigGetter ¶
EnvironConfigGetter is an interface that is provided to NewCertificateUpdater which can be used to get environment 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.