pkg

package
v0.0.0-...-ea333bb Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CronJobFromAnnotations

func CronJobFromAnnotations(annotations []Annotation) (v1.CronJob, error)

func GetLatestVersion

func GetLatestVersion() string

Types

type Annotation

type Annotation struct {
	Key   string
	Value string
}

type CronitorAnnotation

type CronitorAnnotation string
const (
	// AnnotationInclude is the key of the annotation that explicitly
	// controls whether a CronJob will be monitored by Cronitor.
	// Only required when the Cronitor agent is not set to automatically monitor
	// all CronJobs.
	// The only valid values are "true" and "false". Default is "false".
	AnnotationInclude CronitorAnnotation = "k8s.cronitor.io/include"

	// AnnotationExclude is the key of the annotation that explicitly
	// controls whether a CronJob will be monitored by Cronitor.
	// Only required when the Cronitor agent is set to require manual
	// selection of CronJobs to monitor.
	// The only valid values are "true" and "false". Default is "false".
	AnnotationExclude CronitorAnnotation = "k8s.cronitor.io/exclude"

	// AnnotationEnvironment is the environment name that should be sent to Cronitor
	// for the CronJob.
	// Overrides the default chart-wide environment if present.
	AnnotationEnvironment CronitorAnnotation = "k8s.cronitor.io/env"

	// AnnotationTags is a comma-separated list of Cronitor tags for the CronJob.
	// Appends to any chart-wide tags.
	AnnotationTags CronitorAnnotation = "k8s.cronitor.io/tags"

	// AnnotationCronitorID is a pre-existing Cronitor monitor key, for use if you are
	// having the Cronitor agent watch some CronJobs that are already present in Cronitor
	// via manual instrumentation, and you'd like to use the same Monitor object.
	AnnotationCronitorID CronitorAnnotation = "k8s.cronitor.io/cronitor-id"

	// AnnotationCronitorName lets you override the Name created by the agent to
	// create the monitor in Cronitor with a custom specified name. This is especially useful
	// if you are attaching the same CronJob across multiple namespaces/clusters to a single
	// Cronitor Monitor across multiple environments.
	AnnotationCronitorName CronitorAnnotation = "k8s.cronitor.io/cronitor-name"

	// AnnotationCronitorGroup lets you provide the key for a Group within the Cronitor application.
	// This is useful if you want to organize monitors within the Cronitor application as they are first created.
	AnnotationCronitorGroup CronitorAnnotation = "k8s.cronitor.io/cronitor-group"

	// AnnotationCronitorNotify lets you provide a comma-separated list of Notification List
	// keys (https://cronitor.io/app/settings/alerts) to be used for dispatching alerts when a job fails/recovers.
	AnnotationCronitorNotify CronitorAnnotation = "k8s.cronitor.io/cronitor-notify"

	// AnnotationCronitorGraceSeconds lets you provide the number of seconds to wait before sending a failure alert.
	AnnotationCronitorGraceSeconds CronitorAnnotation = "k8s.cronitor.io/cronitor-grace-seconds"

	// AnnotationIDInference lets you decide how the Cronitor ID is determined.
	// The only valid values are "k8s" and "name". Default is "k8s".
	AnnotationIDInference CronitorAnnotation = "k8s.cronitor.io/id-inference"

	// AnnotationNamePrefix lets you control the prefix of the name.
	// Valid options include "none", "namespace" (to prepend namespace/), or any other string, which will be prepended as-is.
	AnnotationNamePrefix CronitorAnnotation = "k8s.cronitor.io/name-prefix"
)

type CronitorConfigParser

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

func NewCronitorConfigParser

func NewCronitorConfigParser(cronjob *v1.CronJob) CronitorConfigParser

func (CronitorConfigParser) GetCronitorID

func (cronitorParser CronitorConfigParser) GetCronitorID() string

GetCronitorID returns the correct Cronitor monitor ID for the CronJob. Defaults to the CronJob's Kubernetes UID if no pre-specified monitor ID is provided by the user.

func (CronitorConfigParser) GetCronitorName

func (cronitorParser CronitorConfigParser) GetCronitorName() string

GetCronitorName returns the name to be used by Cronitor monitor. Allows the namespace to be prepended or not, and allows arbitrary strings as a prefix. Defaults to prepending the namespace if no pre-specified monitor name is provided by the user.

func (CronitorConfigParser) GetEnvironment

func (cronitorParser CronitorConfigParser) GetEnvironment() string

func (CronitorConfigParser) GetGraceSeconds

func (cronitorParser CronitorConfigParser) GetGraceSeconds() int

func (CronitorConfigParser) GetGroup

func (cronitorParser CronitorConfigParser) GetGroup() string

func (CronitorConfigParser) GetNotify

func (cronitorParser CronitorConfigParser) GetNotify() []string

func (CronitorConfigParser) GetSchedule

func (cronitorParser CronitorConfigParser) GetSchedule() string

func (CronitorConfigParser) GetSpecifiedCronitorID

func (cronitorParser CronitorConfigParser) GetSpecifiedCronitorID() string

GetSpecifiedCronitorID returns the pre-specified Cronitor monitor ID, if provided as an annotation on the CronJob object. If not provided, returns an empty string

func (CronitorConfigParser) GetSpecifiedCronitorName

func (cronitorParser CronitorConfigParser) GetSpecifiedCronitorName() string

GetSpecifiedCronitorName returns the pre-specified Cronitor monitor name, if provided as an annotation on the CronJob object. If not provided, returns an empty string

func (CronitorConfigParser) GetTags

func (cronitorParser CronitorConfigParser) GetTags() []string

func (CronitorConfigParser) IsCronJobIncluded

func (cronitorParser CronitorConfigParser) IsCronJobIncluded() (bool, error)

type JobEvent

type JobEvent v1.Event

type PodEvent

type PodEvent v1.Event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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