v1alpha1

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the core v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=core.appvia.io

Index

Constants

View Source
const (
	// ReasonNotDetermined is the default reason when a condition's state has not yet been
	// determined by the controller
	ReasonNotDetermined = "NotDetermined"
	// ReasonWarning should be used as a reason whenever an unexpected error has caused the
	// condition to be in a non-desired state
	ReasonWarning = "Warning"
	// ReasonError should be used as a reason whenever an unexpected error has caused the
	// condition to be in a non-desired state
	ReasonError = "Error"
	// ReasonInProgress should be used as a reason whenever a condition status is caused
	// by an operation being in progress, e.g. deploying, upgrading, whatever.
	ReasonInProgress = "InProgress"
	// ReasonReady should be used as a reason whenever a condition status indicates that
	// some element is now ready for use and available
	ReasonReady = "Ready"
	// ReasonDisabled indicated the feature or options behind this condition is currently
	// disabled
	ReasonDisabled = "Disabled"
	// ReasonComplete should be used as a reason whenever a concrete process represented by a
	// condition is complete.
	ReasonComplete = "Complete"
	// ReasonActionRequired should be used as a reason whenever a condition is in the state it is
	// in due to needing some sort of user or administrator action to resolve it
	ReasonActionRequired = "ActionRequired"
	// ReasonDeleting should be used to indicate the thing represented by this condition is
	// currently in the process of being deleted
	ReasonDeleting = "Deleting"
	// ReasonErrorDeleting should be used as a reason whenever an unexpected error has caused the
	// condition to be in a non-desired state **while deleting**
	ReasonErrorDeleting = "ErrorDeleting"
	// ReasonDeleted should be used to indicate the thing represented by this condition has been
	// deleted
	ReasonDeleted = "Deleted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonStatus

type CommonStatus struct {
	// Conditions represents the observations of the resource's current state.
	// +kubebuilder:validation:Type=array
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	// +kubebuilder:validation:Optional
	Conditions Conditions `json:"conditions,omitempty"`
	// LastReconcile describes the generation and time of the last reconciliation
	// +kubebuilder:validation:Optional
	LastReconcile *LastReconcileStatus `json:"lastReconcile,omitempty"`
	// LastSuccess descibes the generation and time of the last reconciliation which resulted in
	// a Success status
	// +kubebuilder:validation:Optional
	LastSuccess *LastReconcileStatus `json:"lastSuccess,omitempty"`
}

CommonStatus is the common status for a resource +k8s:openapi-gen=true

func (*CommonStatus) DeepCopy

func (in *CommonStatus) DeepCopy() *CommonStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonStatus.

func (*CommonStatus) DeepCopyInto

func (in *CommonStatus) DeepCopyInto(out *CommonStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CommonStatus) GetCommonStatus

func (s *CommonStatus) GetCommonStatus() *CommonStatus

GetCommonStatus returns the standard Wayfinder common status information for the resource

func (*CommonStatus) GetCondition

func (s *CommonStatus) GetCondition(typ ConditionType) *Condition

GetCondition returns the current observed status of a specific element of this resource, or nil if the condition does not exist

func (*CommonStatus) GetConditions

func (s *CommonStatus) GetConditions() Conditions

GetConditions returns the status of any sub-components of this resource

func (*CommonStatus) HasCondition

func (s *CommonStatus) HasCondition(t ConditionType) bool

HasCondition returns true if the condition is in the list

func (*CommonStatus) InCondition

func (s *CommonStatus) InCondition(typ ConditionType) bool

InCondition returns true if the condition specified by typ is present and set to its true state (i.e. metav1.ConditionTrue for a normal condition or metav1.ConditionFalse for a negative polarity condition)

func (*CommonStatus) IsComplete

func (s *CommonStatus) IsComplete(condition ConditionType, generation int64) bool

IsComplete returns true if the condition is complete for a specific generation

func (*CommonStatus) IsFailed added in v0.3.4

func (s *CommonStatus) IsFailed() bool

IsFailed returns true if the status of any of the conditions is in error

type CommonStatusAware

type CommonStatusAware interface {
	client.Object
	GetCommonStatus() *CommonStatus
}

CommonStatusAware is implemented by any Wayfinder resource which has the standard Wayfinder common status implementation +kubebuilder:object:generate=false

type Condition

type Condition struct {

	// Type of condition in CamelCase or in foo.example.com/CamelCase.
	// ---
	// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
	// useful (see .node.status.conditions), the ability to deconflict is important.
	// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
	// +required
	// +kubebuilder:validation:Required
	Type ConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=True;False;Unknown
	Status metav1.ConditionStatus `json:"status"`
	// ObservedGeneration represents the .metadata.generation that the condition was set based upon.
	// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
	// with respect to the current state of the instance.
	// +optional
	// +kubebuilder:validation:Minimum=0
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// LastTransitionTime is the last time the condition transitioned from one status to another.
	// This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Format=date-time
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// Reason contains a programmatic identifier indicating the reason for the condition's last transition.
	// Producers of specific condition types may define expected values and meanings for this field,
	// and whether the values are considered a guaranteed API.
	// The value should be a CamelCase string.
	// This field may not be empty.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=1024
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
	Reason string `json:"reason"`
	// Message is a human readable message indicating details about the transition.
	// This may be an empty string.
	// +optional
	// +kubebuilder:validation:MaxLength=32768
	Message string `json:"message,omitempty"`
	// Name is a human-readable name for this condition.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
	// Detail is any additional human-readable detail to understand this condition, for example,
	// the full underlying error which caused an issue
	// +optional
	Detail string `json:"detail,omitempty"`
}

Condition is the current observed condition of some aspect of a resource +k8s:openapi-gen=true

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Condition) InProgress

func (c *Condition) InProgress() bool

InProgress returns true if the condition indicates the condition is in progress

func (*Condition) IsComplete

func (c *Condition) IsComplete(generation int64) bool

IsComplete returns true if the resource complete for a specific generation

func (*Condition) IsDeleting

func (c *Condition) IsDeleting() bool

IsDeleting returns true if the condition is in status false and has a deleting/deleted reason (i.e. deleting, deleted or error deleting)

func (*Condition) IsFailed

func (c *Condition) IsFailed(generation int64) bool

IsFailed returns true if the resource has a failed state

func (*Condition) IsGeneration added in v0.3.14

func (c *Condition) IsGeneration(generation int64) bool

IsGeneration returns true if the condition was generated by the controller

type ConditionSpec

type ConditionSpec struct {
	// The PascalCase condition type, e.g. ServiceAvailable or InsufficientCapacity.
	// See ConditionType for the rules on condition types.
	Type ConditionType
	// Name is a human-readable name for this condition, used for UI and CLI reporting / explanation
	// If Name is empty, the Type will be used also as the Name.
	Name string
	// DefaultStatus is the default status - if unset, metav1.ConditionUnknown will be used.
	DefaultStatus metav1.ConditionStatus
}

ConditionSpec describes the shape of a condition which will be populated onto the status

func (*ConditionSpec) DeepCopy

func (in *ConditionSpec) DeepCopy() *ConditionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionSpec.

func (*ConditionSpec) DeepCopyInto

func (in *ConditionSpec) DeepCopyInto(out *ConditionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConditionType

type ConditionType string

ConditionType defines a type of a condition in PascalCase or in foo.example.com/PascalCase --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` +kubebuilder:validation:MaxLength=316

const (
	// ConditionReady describes the overall status of the resource. All Wayfinder resources should
	// set ConditionReady
	ConditionReady ConditionType = "Ready"
)

type Conditions

type Conditions []Condition

Conditions is a collection of condition

func (Conditions) DeepCopy

func (in Conditions) DeepCopy() Conditions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions.

func (Conditions) DeepCopyInto

func (in Conditions) DeepCopyInto(out *Conditions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LastReconcileStatus

type LastReconcileStatus struct {
	// Time is the last time the resource was reconciled
	// +kubebuilder:validation:Optional
	Time metav1.Time `json:"time"`
	// Generation is the generation reconciled on the last reconciliation
	// +kubebuilder:validation:Optional
	Generation int64 `json:"generation"`
}

LastReconcileStatus is the status of the last reconciliation +k8s:openapi-gen=true

func (*LastReconcileStatus) DeepCopy

func (in *LastReconcileStatus) DeepCopy() *LastReconcileStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LastReconcileStatus.

func (*LastReconcileStatus) DeepCopyInto

func (in *LastReconcileStatus) DeepCopyInto(out *LastReconcileStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Status

type Status string

Status is the status of a thing

const (
	// DeletingStatus indicates we are deleting the resource
	DeletingStatus Status = "Deleting"
	// DeleteErrorStatus indicates an error has occurred while attempting to delete the resource
	DeleteErrorStatus Status = "DeleteError"
	// DeletedStatus indicates a deleted entity
	DeletedStatus Status = "Deleted"
	// DeleteFailedStatus indicates that deleting the entity failed
	DeleteFailedStatus Status = "DeleteFailed"
	// ErrorStatus indicates that a recoverable error happened
	ErrorStatus Status = "Error"
	// PendingStatus indicate we are waiting
	PendingStatus Status = "Pending"
	// SuccessStatus is a successful resource
	SuccessStatus Status = "Success"
	// FailureStatus indicates the resource has failed for one or more reasons
	FailureStatus Status = "Failure"
	// WarningStatus indicates are warning
	WarningStatus Status = "Warning"
	// Unknown is an unknown status
	Unknown Status = "Unknown"
	// EmptyStatus indicates an empty status
	EmptyStatus Status = ""
	// CreatingStatus indicate we are creating a resource
	CreatingStatus Status = "Creating"
	// UpdatingStatus indicate we are creating a resource
	UpdatingStatus Status = "Updating"
	// ActionRequiredStatus indicates that user action is required to remediate the current state
	// of a resource, e.g. a spec value is wrong or some external action needs to be taken
	ActionRequiredStatus Status = "ActionRequired"
)

func (Status) IsDeleting

func (s Status) IsDeleting() bool

IsDeleting returns true is the resource is being deleted

func (Status) IsError

func (s Status) IsError() bool

IsError returns true if the status is an error

func (Status) IsFailed

func (s Status) IsFailed() bool

IsFailed returns true if the status is a failure

func (Status) IsSuccess

func (s Status) IsSuccess() bool

IsSuccess returns true if the status is a success

func (Status) OneOf

func (s Status) OneOf(statuses ...Status) bool

OneOf returns true if the status is one of the provided statuses

Jump to

Keyboard shortcuts

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