reconcile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 8 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringEqual

func StringEqual(field *string, val string) bool

func StringSet

func StringSet(field **string, val string)

func StringValue

func StringValue(field *string) string

Types

type DefaultReconciler

type DefaultReconciler struct {
}

func (*DefaultReconciler) Command

func (r *DefaultReconciler) Command(logger logger.LogContext, cmd string) Status

func (*DefaultReconciler) Delete

func (r *DefaultReconciler) Delete(logger logger.LogContext, obj resources.Object) Status

func (*DefaultReconciler) Deleted

func (*DefaultReconciler) Reconcile

func (r *DefaultReconciler) Reconcile(logger logger.LogContext, obj resources.Object) Status

func (*DefaultReconciler) Setup

func (r *DefaultReconciler) Setup()

func (*DefaultReconciler) Start

func (r *DefaultReconciler) Start()

type Interface

type Interface interface {
	Setup()
	Start()
	Reconcile(logger.LogContext, resources.Object) Status
	Delete(logger.LogContext, resources.Object) Status
	Deleted(logger.LogContext, resources.ClusterObjectKey) Status
	Command(logger logger.LogContext, cmd string) Status
}

type ReconcilationRejection added in v0.2.0

type ReconcilationRejection interface {
	RejectResourceReconcilation(cluster cluster.Interface, gk schema.GroupKind) bool
}

ReconcilationRejection is an optional interface that can be implemented by a recociler to decide to omit the reconcilation of a dedicated resource the it is registered for by the controller definition

type Status

type Status struct {
	Completed bool
	Error     error

	// Interval selects a modified reconcilation reschedule for the actual item
	// -1 (default) no modification
	//  0 no reschedule
	//  >0 rescgule after given interval
	// If multiple reconcilers are called for an item the Intervals are combined as follows.
	// - if there is at least one status with Interval> 0,the minimum is used
	// - if all status disable reschedule it will be disabled
	// - status with -1 are ignored
	Interval time.Duration
}

func Delay

func Delay(logger logger.LogContext, err error) Status

func DelayOnError

func DelayOnError(logger logger.LogContext, err error, ratelimiter ...utils.RateLimiter) Status

func DelayOnErrorOrReschedule added in v0.2.0

func DelayOnErrorOrReschedule(logger logger.LogContext, err error, d time.Duration) Status

func Failed

func Failed(logger logger.LogContext, err error) Status

func FailedOnError

func FailedOnError(logger logger.LogContext, err error) Status

func FinalUpdate

func FinalUpdate(logger logger.LogContext, modified bool, obj resources.Object) Status

func Recheck

func Recheck(logger logger.LogContext, err error, interval ...time.Duration) Status

func Repeat

func Repeat(logger logger.LogContext, err ...error) Status

func RepeatOnError

func RepeatOnError(logger logger.LogContext, err error) Status

func RescheduleAfter added in v0.2.0

func RescheduleAfter(logger logger.LogContext, d time.Duration) Status

func Succeeded

func Succeeded(logger logger.LogContext, msg ...interface{}) Status

func Update added in v0.2.0

func Update(logger logger.LogContext, upd resources.ObjectUpdater, d ...time.Duration) Status

func UpdateStatus

func UpdateStatus(logger logger.LogContext, upd resources.ObjectStatusUpdater, d ...time.Duration) Status

func (Status) IsDelayed

func (this Status) IsDelayed() bool

func (Status) IsFailed

func (this Status) IsFailed() bool

func (Status) IsSucceeded

func (this Status) IsSucceeded() bool

func (Status) MustBeRepeated

func (this Status) MustBeRepeated() bool

func (Status) RescheduleAfter

func (this Status) RescheduleAfter(d time.Duration) Status

func (Status) Stop

func (this Status) Stop() Status

func (Status) StopIfSucceeded

func (this Status) StopIfSucceeded() Status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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