meltdown

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 4 Imported by: 9

Documentation

Overview

Package meltdown is used by reconcilers to delay reconciling if too many updates happen to a resource

Index

Constants

This section is empty.

Variables

View Source
var AnnotationLastReconcile = fmt.Sprintf("%s/last-reconcile", names.GroupName)

AnnotationLastReconcile is the key name of the timestamp for the last successful reconcile

Functions

func SetLastReconcile

func SetLastReconcile(objectMeta *metav1.ObjectMeta, now time.Time)

SetLastReconcile annotation in object meta to the given time

Types

type Window

type Window struct {
	Start    time.Time
	Duration time.Duration
}

Window represents a time window starting at start and ending at duration

func NewAnnotationWindow

func NewAnnotationWindow(duration time.Duration, annotations map[string]string) Window

NewAnnotationWindow returns a window starting at lastReconcile contained in annotations, ending after duration

func NewWindow

func NewWindow(duration time.Duration, lastReconcile *metav1.Time) Window

NewWindow returns a new time window starting at lastReconcile, ending after duration

func (Window) Contains

func (w Window) Contains(now time.Time) bool

Contains returns true if the given time is in the specified time window

Jump to

Keyboard shortcuts

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