collector

package
v0.0.0-...-f1efe3e Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientSet

func GetClientSet(config *rest.Config) *kubernetes.Clientset

func GetConfig

func GetConfig(pathToKubeconfig string) (*rest.Config, error)

func GetDiscoveryClient

func GetDiscoveryClient(config *rest.Config) *discovery.DiscoveryClient

Types

type CronJobCollection

type CronJobCollection struct {
	// contains filtered or unexported fields
}

func NewCronJobCollection

func NewCronJobCollection(pathToKubeconfig string, namespace string, cronitorApi *api.CronitorApi) (*CronJobCollection, error)

func (*CronJobCollection) AddCronJob

func (coll *CronJobCollection) AddCronJob(cronjob *v1.CronJob)

func (CronJobCollection) CompareServerVersion

func (coll CronJobCollection) CompareServerVersion(major int, minor int) (int, error)

CompareServerVersion will return 1 if the server version is higher than the compared version, -1 if it is lower than the compared version, or 0 if they are the same

func (CronJobCollection) GetAllWatchedCronJobUIDs

func (coll CronJobCollection) GetAllWatchedCronJobUIDs() []types.UID

func (CronJobCollection) GetPreferredBatchApiVersion

func (coll CronJobCollection) GetPreferredBatchApiVersion() (string, error)

func (*CronJobCollection) LoadAllExistingCronJobs

func (coll *CronJobCollection) LoadAllExistingCronJobs() error

func (*CronJobCollection) RemoveCronJob

func (coll *CronJobCollection) RemoveCronJob(cronjob *v1.CronJob)

func (CronJobCollection) StartWatchingAll

func (coll CronJobCollection) StartWatchingAll()

func (CronJobCollection) StopWatchingAll

func (coll CronJobCollection) StopWatchingAll()

type CronJobWatcher

type CronJobWatcher struct {
	// contains filtered or unexported fields
}

func NewCronJobWatcher

func NewCronJobWatcher(coll CronJobCollection) CronJobWatcher

func (CronJobWatcher) StartWatching

func (c CronJobWatcher) StartWatching()

func (CronJobWatcher) StopWatching

func (c CronJobWatcher) StopWatching()

type EventHandler

type EventHandler struct {
	// contains filtered or unexported fields
}

func (EventHandler) CheckJobIsWatched

func (e EventHandler) CheckJobIsWatched(jobNamespace string, jobName string) bool

func (EventHandler) CheckPodFilter

func (e EventHandler) CheckPodFilter(podName string) bool

func (EventHandler) FetchObjectsFromJobEvent

func (e EventHandler) FetchObjectsFromJobEvent(event *pkg.JobEvent) (pod *corev1.Pod, logs string, job *v1.Job, cronjob *v1.CronJob, err error)

func (EventHandler) FetchObjectsFromPodEvent

func (e EventHandler) FetchObjectsFromPodEvent(event *pkg.PodEvent) (pod *corev1.Pod, logs string, job *v1.Job, cronjob *v1.CronJob, err error)

func (EventHandler) OnAdd

func (e EventHandler) OnAdd(obj interface{})

type JobNotFoundError

type JobNotFoundError struct {
	Err error
	// contains filtered or unexported fields
}

func (JobNotFoundError) Error

func (e JobNotFoundError) Error() string

func (JobNotFoundError) Unwrap

func (e JobNotFoundError) Unwrap() error

type PodNotFoundError

type PodNotFoundError struct {
	Err error
	// contains filtered or unexported fields
}

func (PodNotFoundError) Error

func (e PodNotFoundError) Error() string

func (PodNotFoundError) Unwrap

func (e PodNotFoundError) Unwrap() error

type WatchWrapper

type WatchWrapper struct {
	// contains filtered or unexported fields
}

func NewJobsEventWatcher

func NewJobsEventWatcher(collection *CronJobCollection) *WatchWrapper

func (WatchWrapper) Start

func (w WatchWrapper) Start()

func (WatchWrapper) Stop

func (w WatchWrapper) Stop()

Jump to

Keyboard shortcuts

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