controllers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynakubeState

type DynakubeState struct {
	Log      logr.Logger
	Instance *dynatracev1beta1.DynaKube
	Now      metav1.Time

	// If update is true, then changes on instance will be sent to the Kubernetes API.
	//
	// Additionally, if err is not nil, then the Reconciliation will fail with its value. Unless it's a Too Many
	// Requests HTTP error from the Dynatrace API, on which case, a reconciliation is requeued after one minute delay.
	//
	// If err is nil, then a reconciliation is requeued after requeueAfter.
	Err          error
	Updated      bool
	RequeueAfter time.Duration
}

The purpose of this struct is to keep track of the state of the Dynakube during a Reconcile. Because the dynakube_controller is the one that calls most of the other reconcilers, so we pass the to-be-reconciled Dynakube all over the place AND in some cases the reconcilers will update said Dynakube therefore we need to keep track of the state for this Dynakube over the whole Reconcile. (was it updated, etc.)

func NewDynakubeState

func NewDynakubeState(log logr.Logger, dk *dynatracev1beta1.DynaKube) *DynakubeState

func (*DynakubeState) Error

func (dkState *DynakubeState) Error(err error) bool

func (*DynakubeState) IsOutdated

func (dkState *DynakubeState) IsOutdated(last *metav1.Time, threshold time.Duration) bool

func (*DynakubeState) Update

func (dkState *DynakubeState) Update(upd bool, d time.Duration, cause string) bool

Jump to

Keyboard shortcuts

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