status

package
v0.0.0-...-cd07ea3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package status provides a simple mechanism for updating the Status of an v1alpha1.ICoreResource resource

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAccessNotValid

func SetAccessNotValid(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
) error

SetAccessNotValid updates the ConditionAccessStillValid condition to False.

func SetAccessResourcesCreated

func SetAccessResourcesCreated(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
	message string,
) error

SetAccessResourcesCreated updates the ConditionAccessResourcesCreated condition to True.

func SetAccessResourcesNotCreated

func SetAccessResourcesNotCreated(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
	err error,
) error

SetAccessResourcesNotCreated updates the ConditionAccessResourcesCreated condition to False.

func SetAccessResourcesNotReady

func SetAccessResourcesNotReady(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
	err error,
) error

SetAccessResourcesNotReady updates the ConditionAccessResourcesReady condition to False.

func SetAccessResourcesReady

func SetAccessResourcesReady(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
	message string,
) error

SetAccessResourcesReady updates the ConditionAccessResourcesReady condition to True.

func SetAccessStillValid

func SetAccessStillValid(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
) error

SetAccessStillValid updates the ConditionAccessStillValid condition to True.

func SetReadyStatus

func SetReadyStatus(ctx context.Context, rec hasStatusReconciler, res api.ICoreResource) error

SetReadyStatus flips the Status.Ready field to true or false. This is used at the end of a reconciliation loop when all of the conditions of the resource are known to have been populated. If all Conditions are in the ConditionSuccess status, then Status.Ready is set to true. Otherwise, it is set to False.

Status.Ready is used by the 'ozctl' commandline tool to inform users when their access request has been approved and configured.

func SetRequestDurationsNotValid

func SetRequestDurationsNotValid(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
	reason string,
) error

SetRequestDurationsNotValid updates the ConditionRequestDurationsValid condition on a Request resource to a failure.

func SetRequestDurationsValid

func SetRequestDurationsValid(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
	reason string,
) error

SetRequestDurationsValid updates the ConditionRequestDurationsValid condition on a Request resource to a success.

func SetTargetRefExists

func SetTargetRefExists(
	ctx context.Context,
	rec hasStatusReconciler,
	tmpl v1alpha1.ITemplateResource,
	message string,
) error

SetTargetRefExists updates the ConditionTargetRefExists condition on a Template resource to success.

func SetTargetRefNotExists

func SetTargetRefNotExists(
	ctx context.Context,
	rec hasStatusReconciler,
	tmpl v1alpha1.ITemplateResource,
	err error,
) error

SetTargetRefNotExists updates the ConditionTargetRefExists condition on a Template resource to a failure based on the Error supplied.

func SetTargetTemplateExists

func SetTargetTemplateExists(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
) error

SetTargetTemplateExists sets the ConditionTargetTemplateExists condition to True

func SetTargetTemplateNotExists

func SetTargetTemplateNotExists(
	ctx context.Context,
	rec hasStatusReconciler,
	req v1alpha1.IRequestResource,
	err error,
) error

SetTargetTemplateNotExists sets the ConditionTargetTemplateExists condition to False

func SetTemplateDurationsNotValid

func SetTemplateDurationsNotValid(
	ctx context.Context,
	rec hasStatusReconciler,
	tmpl v1alpha1.ITemplateResource,
	reason string,
) error

SetTemplateDurationsNotValid updates the ConditionTemplateDurationsValid condition on a Template resource to a failure.

func SetTemplateDurationsValid

func SetTemplateDurationsValid(
	ctx context.Context,
	rec hasStatusReconciler,
	tmpl v1alpha1.ITemplateResource,
	reason string,
) error

SetTemplateDurationsValid updates the ConditionTemplateDurationsValid condition on a Template resource to a success.

func UpdateCondition

func UpdateCondition(
	ctx context.Context,
	rec hasStatusReconciler,
	res api.ICoreResource,
	conditionType v1alpha1.IConditionType,
	conditionStatus metav1.ConditionStatus,
	reason string,
	message string,
) error

UpdateCondition provides a simple way to update the .Status.Conditions field of a given resource. The resource must match the ResourceWithConditions interface - which exposes the GetConditions() method.

When an updateCondition() call is made, we retrieve the current list of conditions first from the request object. From there, we insert in a new Condition into the resource. Finally we call the UpdateStatus() function to push the update to Kubernetes.

revive:disable:argument-limit long but reasonable

func UpdateStatus

func UpdateStatus(ctx context.Context, rec hasStatusReconciler, res api.ICoreResource) error

UpdateStatus pushes the client.Object.Status field into Kubernetes if it has been updated, and then takes care of calling Refetch() to re-populate the object pointer with the updated object revision from Kubernetes.

This wrapper makes it much easier to update the Status field of an object iteratively throughout a reconciliation loop.

Types

This section is empty.

Jump to

Keyboard shortcuts

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