Documentation
¶
Index ¶
- type EventBroadcasterProducer
- type EventRecorderGetter
- type Manager
- func (m *Manager) GetEventRecorder(cfg *rest.Config, name, clusterName logicalcluster.Name) events.EventRecorder
- func (m *Manager) GetEventRecorderFor(cfg *rest.Config, name, clusterName logicalcluster.Name) record.EventRecorder
- func (m *Manager) GetProvider(unawareConfig *rest.Config, clusterName logicalcluster.Name) (*Provider, error)
- func (m *Manager) Stop(ctx context.Context)
- func (m *Manager) StopProvider(ctx context.Context, clusterName logicalcluster.Name)
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBroadcasterProducer ¶
type EventBroadcasterProducer func() (deprecatedCaster record.EventBroadcaster, caster events.EventBroadcaster, stopWithProvider bool)
EventBroadcasterProducer makes an event broadcaster, returning whether or not the broadcaster should be stopped with the Provider, or not (e.g. if it's shared, it shouldn't be stopped with the Provider). This producer currently produces both an old API and a new API broadcaster.
type EventRecorderGetter ¶ added in v0.5.0
type EventRecorderGetter interface {
GetEventRecorderFor(string) record.EventRecorder
GetEventRecorder(string) events.EventRecorder
}
EventRecorderGetter is an interface for the Provider.
type Manager ¶ added in v0.5.0
type Manager struct {
// contains filtered or unexported fields
}
Manager manages Providers.
func NewManager ¶ added in v0.5.0
NewManager sets up a new Manager.
func (*Manager) GetEventRecorder ¶ added in v0.5.0
func (m *Manager) GetEventRecorder(cfg *rest.Config, name, clusterName logicalcluster.Name) events.EventRecorder
GetEventRecorder returns an event recorder that broadcasts to this provider's broadcaster. All events will be associated with a component of the given name.
func (*Manager) GetEventRecorderFor ¶ added in v0.5.0
func (m *Manager) GetEventRecorderFor(cfg *rest.Config, name, clusterName logicalcluster.Name) record.EventRecorder
GetEventRecorderFor returns an event recorder that broadcasts to this provider's broadcaster. All events will be associated with a component of the given name.
func (*Manager) GetProvider ¶ added in v0.5.0
func (m *Manager) GetProvider(unawareConfig *rest.Config, clusterName logicalcluster.Name) (*Provider, error)
GetProvider returns a Provider for the specified cluster.
func (*Manager) StopProvider ¶ added in v0.5.0
func (m *Manager) StopProvider(ctx context.Context, clusterName logicalcluster.Name)
StopProvider stops the Provider for the specified cluster.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a recorder.Provider that records events to the k8s API server and to a logr Logger.
func NewProvider ¶
func NewProvider(config *rest.Config, httpClient *http.Client, scheme *runtime.Scheme, logger logr.Logger, makeBroadcaster EventBroadcasterProducer) (*Provider, error)
NewProvider create a new Provider instance.
func (*Provider) GetEventRecorder ¶ added in v0.5.0
func (p *Provider) GetEventRecorder(name string) events.EventRecorder
GetEventRecorder returns an event recorder that broadcasts to this provider's broadcaster. All events will be associated with a component of the given name.
func (*Provider) GetEventRecorderFor ¶
func (p *Provider) GetEventRecorderFor(name string) record.EventRecorder
GetEventRecorderFor returns an event recorder that broadcasts to this provider's broadcaster. All events will be associated with a component of the given name.
func (*Provider) Stop ¶
Stop attempts to stop this provider, stopping the underlying broadcaster if the broadcaster asked to be stopped. It kinda tries to honor the given context, but the underlying broadcaster has an indefinite wait that doesn't return until all queued events are flushed, so this may end up just returning before the underlying wait has finished instead of cancelling the wait. This is Very Frustrating™.