Documentation
¶
Index ¶
- Variables
- type Controller
- type DataGatherInformer
- type InsightsDataGatherObserverMock
- func (i InsightsDataGatherObserverMock) GatherConfig() *configv1.GatherConfig
- func (i InsightsDataGatherObserverMock) GatherDisabled() bool
- func (i InsightsDataGatherObserverMock) Name() string
- func (i InsightsDataGatherObserverMock) Run(_ context.Context, _ int)
- func (i InsightsDataGatherObserverMock) Sync(_ context.Context, _ factory.SyncContext) error
- type JobCompletionWatcher
- type JobController
- type JobWatcher
Constants ¶
This section is empty.
Variables ¶
var ErrJobFailed = errors.New("job failed")
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller periodically runs gatherers, records their results to the recorder and flushes the recorder to create archives
func New ¶
func New( configAggregator configobserver.Interface, rec recorder.FlushInterface, listGatherers []gatherers.Interface, anonymizer *anonymization.Anonymizer, insightsOperatorCLI operatorv1client.InsightsOperatorInterface, kubeClient *kubernetes.Clientset, ) *Controller
New creates a new instance of Controller which periodically invokes the gatherers and flushes the recorder to create archives.
func NewWithTechPreview ¶
func NewWithTechPreview( reportRetriever *insightsreport.Controller, configAggregator configobserver.Interface, apiConfigurator configobserver.InsightsDataGatherObserver, listGatherers []gatherers.Interface, kubeClient kubernetes.Interface, dataGatherClient insightsv1cli.InsightsV1Interface, insightsOperatorCli operatorv1client.InsightsOperatorInterface, openshiftConfCli configv1client.ConfigV1Interface, dgInf DataGatherInformer, jobInf JobWatcher, ) *Controller
func (*Controller) Gather ¶
func (c *Controller) Gather()
Gather Runs the gatherers one after the other.
func (*Controller) GatherJob ¶
func (c *Controller) GatherJob()
func (*Controller) PeriodicPrune ¶
func (c *Controller) PeriodicPrune(ctx context.Context)
PeriodicPrune runs periodically and deletes jobs (including the related pods) and "datagather.insights.openshift.io" resources older than 24 hours
func (*Controller) Run ¶
func (c *Controller) Run(stopCh <-chan struct{}, initialDelay time.Duration)
func (*Controller) Sources ¶
func (c *Controller) Sources() []controllerstatus.StatusController
type DataGatherInformer ¶
type DataGatherInformer interface {
factory.Controller
DataGatherCreated() <-chan string
}
DataGatherInformer is an interface providing information about newly create DataGather resources
func NewDataGatherInformer ¶
func NewDataGatherInformer(eventRecorder events.Recorder, insightsInf insightsInformers.SharedInformerFactory) (DataGatherInformer, error)
NewDataGatherInformer creates a new instance of the DataGatherInformer interface
type InsightsDataGatherObserverMock ¶
type InsightsDataGatherObserverMock struct {
// contains filtered or unexported fields
}
func NewInsightsDataGatherObserverMock ¶
func NewInsightsDataGatherObserverMock( mockedDataPolicy []configv1.DataPolicyOption, mockedGatherers configv1.Gatherers, ) *InsightsDataGatherObserverMock
func (InsightsDataGatherObserverMock) GatherConfig ¶
func (i InsightsDataGatherObserverMock) GatherConfig() *configv1.GatherConfig
func (InsightsDataGatherObserverMock) GatherDisabled ¶
func (i InsightsDataGatherObserverMock) GatherDisabled() bool
func (InsightsDataGatherObserverMock) Name ¶
func (i InsightsDataGatherObserverMock) Name() string
func (InsightsDataGatherObserverMock) Run ¶
func (i InsightsDataGatherObserverMock) Run(_ context.Context, _ int)
func (InsightsDataGatherObserverMock) Sync ¶
func (i InsightsDataGatherObserverMock) Sync(_ context.Context, _ factory.SyncContext) error
type JobCompletionWatcher ¶
type JobCompletionWatcher struct {
factory.Controller
// contains filtered or unexported fields
}
func NewJobCompletionWatcher ¶
func NewJobCompletionWatcher( eventRecorder events.Recorder, sharedInformers informers.SharedInformerFactory, ) (*JobCompletionWatcher, error)
func (*JobCompletionWatcher) DeletedJob ¶
func (w *JobCompletionWatcher) DeletedJob() <-chan string
func (*JobCompletionWatcher) FinishedJob ¶
func (w *JobCompletionWatcher) FinishedJob() <-chan string
type JobController ¶
type JobController struct {
// contains filtered or unexported fields
}
JobController type responsible for creating a new gathering jobs
func NewJobController ¶
func NewJobController(kubeClient kubernetes.Interface) *JobController
func (*JobController) CreateGathererJob ¶
func (j *JobController) CreateGathererJob( ctx context.Context, image string, dataReporting *config.DataReporting, dataGather *insightsv1.DataGather, ) (*batchv1.Job, error)
CreateGathererJob creates a new Kubernetes Job with provided image, volume mount path used for storing data archives and name derived from the provided data gather name
func (*JobController) WaitForJobCompletion ¶
WaitForJobCompletion listen the Kubernetes events to check if job finished.
type JobWatcher ¶
type JobWatcher interface {
factory.Controller
FinishedJob() <-chan string
DeletedJob() <-chan string
}