status

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUpdateInterval = 5 * time.Minute
)

Variables

This section is empty.

Functions

func SetDynakubeStatus

func SetDynakubeStatus(instance *dynatracev1beta1.DynaKube, opts Options) error

Types

type DynakubeState

type DynakubeState struct {
	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
	ValidTokens  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(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, cause string) bool

type Options

type Options struct {
	Dtc       dtclient.Client
	ApiClient client.Reader
}

Jump to

Keyboard shortcuts

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