Documentation ¶
Overview ¶
Package reporter is responsible for collecting per-node resources for scheduler; those resources are collected through multiple different sources, and updated in different K8S objects for needs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRegisteredInitializers ¶
func GetRegisteredInitializers() map[metav1.GroupVersionKind]InitFunc
func RegisterReporterInitializer ¶
func RegisterReporterInitializer(gvk metav1.GroupVersionKind, initFunc InitFunc)
Types ¶
type InitFunc ¶
type InitFunc func(*client.GenericClientSet, *metaserver.MetaServer, metrics.MetricEmitter, *config.Configuration) (Reporter, error)
InitFunc is used to initialize a particular reporter.
type Manager ¶
type Manager interface { // PushContents gets ReportField list from report manager, the reporter implementation // should be responsible for assembling and updating the specific object. PushContents(ctx context.Context, responses map[string]*v1alpha1.GetReportContentResponse) error // Run starts all the updaters registered in this Manager. Run(ctx context.Context) }
Manager indicates the way that resources are updated, and it is also responsible for other
func NewReporterManager ¶
func NewReporterManager(genericClient *client.GenericClientSet, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration) (Manager, error)
NewReporterManager is to create a reporter manager
type ManagerStub ¶
type ManagerStub struct {
// contains filtered or unexported fields
}
ManagerStub a reporter manager stub
func NewReporterManagerStub ¶
func NewReporterManagerStub() *ManagerStub
NewReporterManagerStub new a reporter stub
func (*ManagerStub) GetReportContentResponse ¶
func (s *ManagerStub) GetReportContentResponse(pluginName string) *v1alpha1.GetReportContentResponse
GetReportContentResponse get reporter content from local cache
func (*ManagerStub) PushContents ¶
func (s *ManagerStub) PushContents(_ context.Context, responses map[string]*v1alpha1.GetReportContentResponse) error
PushContents store response to local cache
func (*ManagerStub) Run ¶
func (s *ManagerStub) Run(context.Context)
Run start the reporter manager stub
type Reporter ¶
type Reporter interface { // Update receives ReportField list from report manager, the reporter implementation // should be responsible for assembling and updating the specific object // todo: consider whether we should perform real update actions asynchronously Update(ctx context.Context, fields []*v1alpha1.ReportField) error // Run starts the syncing logic of reporter Run(ctx context.Context) }
Reporter use to update specific kind crd
type Stub ¶
type Stub struct {
// contains filtered or unexported fields
}
func NewReporterStub ¶
func NewReporterStub() *Stub
func (*Stub) GetReportedFields ¶
func (s *Stub) GetReportedFields() []*v1alpha1.ReportField
GetReportedFields get current fields just for test