controller

package
v1.10.9 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new CDI Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

func GetConditionValues added in v1.10.3

func GetConditionValues(conditionList []conditions.Condition) map[conditions.ConditionType]corev1.ConditionStatus

GetConditionValues gets the conditions and put them into a map for easy comparison

func MarkCrDeploying added in v1.10.3

func MarkCrDeploying(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrDeploying marks the passed CR as currently deploying. The CR object needs to be updated by the caller afterwards. Deploying means the following status conditions are set: ApplicationAvailable: false Progressing: true Degraded: false

func MarkCrFailed added in v1.10.3

func MarkCrFailed(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrFailed marks the passed CR as failed and requiring human intervention. The CR object needs to be updated by the caller afterwards. Failed means the following status conditions are set: ApplicationAvailable: false Progressing: false Degraded: true

func MarkCrFailedHealing added in v1.10.3

func MarkCrFailedHealing(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrFailedHealing marks the passed CR as failed and healing. The CR object needs to be updated by the caller afterwards. FailedAndHealing means the following status conditions are set: ApplicationAvailable: false Progressing: true Degraded: true

func MarkCrHealthyMessage added in v1.10.3

func MarkCrHealthyMessage(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrHealthyMessage marks the passed in CR as healthy. The CR object needs to be updated by the caller afterwards. Healthy means the following status conditions are set: ApplicationAvailable: true Progressing: false Degraded: false

func MarkCrUpgradeHealingDegraded added in v1.10.3

func MarkCrUpgradeHealingDegraded(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrUpgradeHealingDegraded marks the passed CR as upgrading and degraded. The CR object needs to be updated by the caller afterwards. Failed means the following status conditions are set: ApplicationAvailable: true Progressing: true Degraded: true

Types

type ReconcileCDI

type ReconcileCDI struct {
	// contains filtered or unexported fields
}

ReconcileCDI reconciles a CDI object

func (*ReconcileCDI) Reconcile

func (r *ReconcileCDI) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a CDI object and makes changes based on the state read and what is in the CDI.Spec Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type ReconcileCallback added in v1.10.3

type ReconcileCallback func(args *ReconcileCallbackArgs) error

ReconcileCallback is the callback function

type ReconcileCallbackArgs added in v1.10.3

type ReconcileCallbackArgs struct {
	Logger logr.Logger
	Client client.Client
	Scheme *runtime.Scheme

	State         ReconcileState
	DesiredObject runtime.Object
	CurrentObject runtime.Object
}

ReconcileCallbackArgs contains the data of a ReconcileCallback

type ReconcileState added in v1.10.3

type ReconcileState string

ReconcileState is the current state of the reconcile for a particuar resource

const (
	// ReconcileStatePreCreate is the state before a resource is created
	ReconcileStatePreCreate ReconcileState = "PRE_CREATE"
	// ReconcileStatePostCreate is the state sfter a resource is created
	ReconcileStatePostCreate ReconcileState = "POST_CREATE"

	// ReconcileStatePostRead is the state sfter a resource is read
	ReconcileStatePostRead ReconcileState = "POST_READ"

	// ReconcileStatePreUpdate is the state before a resource is updated
	ReconcileStatePreUpdate ReconcileState = "PRE_UPDATE"
	// ReconcileStatePostUpdate is the state after a resource is updated
	ReconcileStatePostUpdate ReconcileState = "POST_UPDATE"

	// ReconcileStatePreDelete is the state before a resource is explicitly deleted (probably during upgrade)
	// don't count on this always being called for your resource
	// ideally we just let garbage collection do it's thing
	ReconcileStatePreDelete ReconcileState = "PRE_DELETE"
	// ReconcileStatePostDelete is the state after a resource is explicitly deleted (probably during upgrade)
	// don't count on this always being called for your resource
	// ideally we just let garbage collection do it's thing
	ReconcileStatePostDelete ReconcileState = "POST_DELETE"

	// ReconcileStateCDIDelete is called during CDI finalizer
	ReconcileStateCDIDelete ReconcileState = "CDI_DELETE"
)

Jump to

Keyboard shortcuts

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