service

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Hostname    = "HOSTNAME"
	KeepLast    = "KEEP_LAST"
	KeepHourly  = "KEEP_HOURLY"
	KeepDaily   = "KEEP_DAILY"
	KeepWeekly  = "KEEP_WEEKLY"
	KeepMonthly = "KEEP_MONTHLY"
	KeepYearly  = "KEEP_YEARLY"
	KeepTag     = "KEEP_TAG"
	StatsURL    = "STATS_URL"
	RestorePath = "/restore"
	PromURL     = "PROM_URL"
)

Shared constants between the various services

Variables

This section is empty.

Functions

func DefaultEnvs added in v0.1.2

func DefaultEnvs(backend *backupv1alpha1.Backend, config config.Global) []corev1.EnvVar

func GetBasicJob

func GetBasicJob(namePrefix string, config config.Global, object metav1.Object) *batchv1.Job

func GetRepository

func GetRepository(obj interface{}) string

func NewOwnerReference

func NewOwnerReference(object metav1.Object) metav1.OwnerReference

func PseudoUUID

func PseudoUUID() string

PseudoUUID is used to generate IDs for baas related pods/jobs

Types

type CommonObjects

type CommonObjects struct {
	BaasCLI baas8scli.Interface
	CrdCli  crd.Interface
	K8sCli  kubernetes.Interface
	Logger  log.Logger
}

type Handler

type Handler interface {
	// Ensure will ensure that the service is correcly registered in a schedule
	Ensure(pt runtime.Object) error
	// Delete will stop and delete the object from the operator. Kubernetes will
	// handle the deletion of all child items.
	Delete(name string) error
}

Handler is the interface a service has to implement. These are the functions that get triggered by the kooper framework as soon as a change is found or after the configured resync period.

type Runner

type Runner interface {
	Stop() error
	// SameSpec should check if the spec has changed and the runner has to be
	// recreated. This is mostly necessary for long running things like the
	// scheduler. One-time jobs don't usually need this and can just return
	// true.
	SameSpec(object runtime.Object) bool
	Start() error
}

Runner is an interface that a backup service has to satisfy. Runners actually DO the jobs (restore,archive, backup, etc).

Directories

Path Synopsis
Package observe contains a very special "operator".
Package observe contains a very special "operator".

Jump to

Keyboard shortcuts

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