periodic

package
v0.0.0-...-898015a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 insightsv1alpha1cli.InsightsV1alpha1Interface,
	insightsOperatorCLI operatorv1client.InsightsOperatorInterface,
	dgInf DataGatherInformer,

) *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

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 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, dataGatherName, image, archiveVolumeMountPath string) (*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

func (j *JobController) WaitForJobCompletion(ctx context.Context, job *batchv1.Job) error

WaitForJobCompletion listen the Kubernetes events to check if job finished.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL