Documentation ¶
Index ¶
Constants ¶
const ( UnknownString = "Unknown" CreatedString = "Created" UpdatedString = "Updated" DeletedString = "Deleted" )
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 Event ¶ added in v0.5.0
type Event int
func (Event) RegisterAction ¶ added in v0.5.0
func (event Event) RegisterAction(recorder record.EventRecorder, child, parent client.Object)
RegisterAction registers an event. The action is registered against the parent object. For cluster-scoped resources, you will see the events when describing the object and nowhere else. For namespace-scoped resources, you can also see the events by getting events in the particular namespace.
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" )