status

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 2 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildResource

type ChildResource struct {
	// Group defines the API Group of the resource.
	Group string `json:"group"`

	// Version defines the API Version of the resource.
	Version string `json:"version"`

	// Kind defines the kind of the resource.
	Kind string `json:"kind"`

	// Name defines the name of the resource from the metadata.name field.
	Name string `json:"name"`

	// Namespace defines the namespace in which this resource exists in.
	Namespace string `json:"namespace"`

	// ResourceCondition defines the current condition of this resource.
	ChildResourceCondition `json:"condition,omitempty"`
}

ChildResource is the resource and its condition as stored on the workload custom resource's status field.

func ToCommonResource

func ToCommonResource(resource client.Object) *ChildResource

ToCommonResource converts a client.Object into a common API resource.

type ChildResourceCondition

type ChildResourceCondition struct {
	// Created defines whether this object has been successfully created or not.
	Created bool `json:"created"`

	// LastModified defines the time in which this resource was updated.
	LastModified string `json:"lastModified,omitempty"`

	// Message defines a helpful message from the resource phase.
	Message string `json:"message,omitempty"`
}

ChildResourceCondition describes the condition of a Kubernetes resource managed by the parent object.

func GetFailResourceCondition

func GetFailResourceCondition(err error) ChildResourceCondition

GetFailResourceCondition defines the fail condition for the phase.

func GetPendingResourceCondition

func GetPendingResourceCondition() ChildResourceCondition

GetPendingResourceCondition defines the pending condition for the phase.

func GetSuccessResourceCondition

func GetSuccessResourceCondition() ChildResourceCondition

GetSuccessResourceCondition defines the success condition for the phase.

type PhaseCondition

type PhaseCondition struct {
	State PhaseState `json:"state"`

	// Phase defines the phase in which the condition was set.
	Phase string `json:"phase"`

	// Message defines a helpful message from the phase.
	Message string `json:"message"`

	// LastModified defines the time in which this component was updated.
	LastModified string `json:"lastModified"`
}

PhaseCondition describes an event that has occurred during a phase of the controller reconciliation loop.

func GetFailCondition

func GetFailCondition(name string, err error) PhaseCondition

GetFailCondition defines the fail condition for the phase.

func GetPendingCondition

func GetPendingCondition(name string) PhaseCondition

GetPendingCondition defines the pending condition for the phase.

func GetSuccessCondition

func GetSuccessCondition(name string) PhaseCondition

GetSuccessCondition defines the success condition for the phase.

type PhaseState

type PhaseState string

PhaseState defines the current state of the phase. +kubebuilder:validation:Enum=Complete;Reconciling;Failed;Pending

const (
	PhaseStatePending     PhaseState = "Pending"
	PhaseStateReconciling PhaseState = "Reconciling"
	PhaseStateFailed      PhaseState = "Failed"
	PhaseStateComplete    PhaseState = "Complete"
)

Jump to

Keyboard shortcuts

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