status

package
v2.10.1 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: 6 Imported by: 0

Documentation

Overview

Package status contains different conditions, phases and progresses, being used by DataScienceCluster and DSCInitialization's controller

Index

Constants

View Source
const (
	// PhaseIgnored is used when a resource is ignored
	// is an example of a constant that is not used anywhere in the code.
	PhaseIgnored = "Ignored"
	// PhaseNotReady is used when waiting for system to be ready after reconcile is successful
	// is an example of a constant that is not used anywhere in the code.
	PhaseNotReady = "Not Ready"
	// PhaseClusterExpanding is used when cluster is expanding capacity
	// is an example of a constant that is not used anywhere in the code.
	PhaseClusterExpanding = "Expanding Capacity"
	// PhaseDeleting is used when cluster is deleting
	// is an example of a constant that is not used anywhere in the code.
	PhaseDeleting = "Deleting"
	// PhaseConnecting is used when cluster is connecting to external cluster
	// is an example of a constant that is not used anywhere in the code.
	PhaseConnecting = "Connecting"
	// PhaseOnboarding is used when consumer is Onboarding
	// is an example of a constant that is not used anywhere in the code.
	PhaseOnboarding = "Onboarding"

	// PhaseProgressing is used when SetProgressingCondition() is called.
	PhaseProgressing = "Progressing"
	// PhaseError is used when SetErrorCondition() is called.
	PhaseError = "Error"
	// PhaseReady is used when SetCompleteCondition is called.
	PhaseReady = "Ready"
)

These constants represent the overall Phase as used by .Status.Phase.

View Source
const (
	// ReconcileFailed is used when multiple DSCI instance exists or DSC reconcile failed/removal failed.
	ReconcileFailed                       = "ReconcileFailed"
	ReconcileInit                         = "ReconcileInit"
	ReconcileCompleted                    = "ReconcileCompleted"
	ReconcileCompletedWithComponentErrors = "ReconcileCompletedWithComponentErrors"
	ReconcileCompletedMessage             = "Reconcile completed successfully"

	// ConditionReconcileComplete represents extra Condition Type, used by .Condition.Type.
	ConditionReconcileComplete conditionsv1.ConditionType = "ReconcileComplete"
)

List of constants to show different reconciliation messages and statuses.

View Source
const (
	CapabilityServiceMesh              conditionsv1.ConditionType = "CapabilityServiceMesh"
	CapabilityServiceMeshAuthorization conditionsv1.ConditionType = "CapabilityServiceMeshAuthorization"
)
View Source
const (
	MissingOperatorReason string = "MissingOperator"
	ConfiguredReason      string = "Configured"
	RemovedReason         string = "Removed"
	CapabilityFailed      string = "CapabilityFailed"
)
View Source
const (
	ReadySuffix = "Ready"
)

Variables

This section is empty.

Functions

func RemoveComponentCondition added in v2.1.0

func RemoveComponentCondition(conditions *[]conditionsv1.Condition, component string)

RemoveComponentCondition remove Condition of giving component.

func SetCompleteCondition

func SetCompleteCondition(conditions *[]conditionsv1.Condition, reason string, message string)

SetCompleteCondition sets the ConditionReconcileComplete to True and other Conditions to indicate that the reconciliation process has completed successfully.

func SetComponentCondition added in v2.1.0

func SetComponentCondition(conditions *[]conditionsv1.Condition, component string, reason string, message string, status corev1.ConditionStatus)

SetComponentCondition appends Condition Type with const ReadySuffix for given component when component finished reconcile.

func SetErrorCondition

func SetErrorCondition(conditions *[]conditionsv1.Condition, reason string, message string)

SetErrorCondition sets the ConditionReconcileComplete to False in case of any errors during the reconciliation process.

func SetProgressingCondition

func SetProgressingCondition(conditions *[]conditionsv1.Condition, reason string, message string)

SetProgressingCondition sets the ProgressingCondition to True and other conditions to false or Unknown. Used when we are just starting to reconcile, and there are no existing conditions.

func UpdateWithRetry added in v2.10.1

func UpdateWithRetry[T client.Object](ctx context.Context, cli client.Client, original T, update SaveStatusFunc[T]) (T, error)

UpdateWithRetry updates the status of object using passed function and retries on conflict.

Types

type CalculateCondition added in v2.10.1

type CalculateCondition[T client.Object] func(err error) SaveStatusFunc[T]

CalculateCondition is a closure function that allow to define how condition should be set. It can use Reporter.Err if available to set faulty condition. It should return a SaveStatusFunc which will be used to update the status of the object.

type Reporter added in v2.10.1

type Reporter[T client.Object] struct {
	// contains filtered or unexported fields
}

Reporter defines how the condition should be updated. Its centerpiece is an calculateCondition closure which contains the logic of how the given condition should be calculated.

func NewStatusReporter added in v2.10.1

func NewStatusReporter[T client.Object](cli client.Client, object T, calculate CalculateCondition[T]) *Reporter[T]

NewStatusReporter creates r new Reporter with all required fields.

func (*Reporter[T]) ReportCondition added in v2.10.1

func (r *Reporter[T]) ReportCondition(optionalErr error) (T, error)

ReportCondition updates the status of the object using the calculateCondition function.

type SaveStatusFunc added in v2.10.1

type SaveStatusFunc[T client.Object] func(saved T)

SaveStatusFunc is a closure function that allow to define custom logic of updating status of a concrete resource object.

Jump to

Keyboard shortcuts

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