conditions

package
v0.0.0-...-54c47e7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenStackConditionReasonReady          = "Ready"
	OpenStackConditionReadonNotReady       = "NotReady"
	OpenStackConditionReasonNoError        = "NoError"
	OpenStackConditionReasonBadCredentials = "BadCredentials"
	OpenStackConditionReasonDeleting       = "Deleting"
)

Variables

This section is empty.

Functions

func ConditionMatches

func ConditionMatches(a, b *metav1.Condition) bool

func EmitEventForCondition

func EmitEventForCondition(recorder record.EventRecorder, openStackResource runtime.Object, eventType string, condition *metav1.Condition)

EmitEventForCondition emits an event for the given condition on the OpenStack resource.

func ErrorCondition

func ErrorCondition(errorReason, errorMessage string) metav1.Condition

func GetCondition

func GetCondition(openStackResource openstackv1.OpenStackResourceCommonStatus, conditionType string) *metav1.Condition

GetCondition returns the condition with the given type on the OpenStack resource, or nil if it does not exist.

func InitialiseRequiredConditions

func InitialiseRequiredConditions(openStackResource, patch openstackv1.OpenStackResourceCommonStatus) (updated bool)

InitialiseRequiredConditions initialises an empty set of required conditions in an OpenStack resource.

func IsReady

func IsReady(openStackResource openstackv1.OpenStackResourceCommonStatus) bool

func NotReadyConditionDeleting

func NotReadyConditionDeleting(status string) metav1.Condition

func NotReadyError

func NotReadyError(errorMessage string) metav1.Condition

func NotReadyPending

func NotReadyPending() metav1.Condition

func NotReadyTransientError

func NotReadyTransientError(errorMessage string) metav1.Condition

func NotReadyWaiting

func NotReadyWaiting(objects []Dependency) metav1.Condition

func ReadyCondition

func ReadyCondition(ready bool) metav1.Condition

func SetCondition

func SetCondition(openStackResource, patch openstackv1.OpenStackResourceCommonStatus, condition metav1.Condition) (bool, *metav1.Condition)

SetCondition sets a condition on an OpenStack resource. Returns true if the condition was updated from the original resource.

func SetErrorCondition

func SetErrorCondition(openStackResource, patch openstackv1.OpenStackResourceCommonStatus, errorReason, errorMessage string) (bool, *metav1.Condition)

SetErrorCondition sets the Error condition on an OpenStack resource. It returns the condition that was set.

func SetNotReadyConditionDeleting

func SetNotReadyConditionDeleting(openStackResource, patch openstackv1.OpenStackResourceCommonStatus, status string) (bool, *metav1.Condition)

func SetNotReadyConditionError

func SetNotReadyConditionError(openStackResource, patch openstackv1.OpenStackResourceCommonStatus, errorMessage string) (bool, *metav1.Condition)

func SetNotReadyConditionPending

func SetNotReadyConditionPending(openStackResource, patch openstackv1.OpenStackResourceCommonStatus) (bool, *metav1.Condition)

func SetNotReadyConditionTransientError

func SetNotReadyConditionTransientError(openStackResource, patch openstackv1.OpenStackResourceCommonStatus, errorMessage string) (bool, *metav1.Condition)

func SetNotReadyConditionWaiting

func SetNotReadyConditionWaiting(openStackResource, patch openstackv1.OpenStackResourceCommonStatus, objects []Dependency) (bool, *metav1.Condition)

SetNotReadyConditionWaiting sets the WaitingFor condition on an OpenStack resource. It returns the condition that was set.

func SetReadyCondition

func SetReadyCondition(openStackResource, patch openstackv1.OpenStackResourceCommonStatus) (bool, *metav1.Condition)

SetReadyCondition sets the Ready condition on an OpenStack resource. It returns the condition that was set.

Types

type Dependency

type Dependency struct {
	client.ObjectKey
	Resource string
}

Dependency describes an object that a resource is waiting for

func (Dependency) String

func (d Dependency) String() string

String returns a string representation of the dependency

Jump to

Keyboard shortcuts

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