Documentation
¶
Index ¶
- Constants
- type Condition
- func FalseCondition(t ConditionType, reason ConditionReason, message string) Condition
- func NewCondition(condition ConditionType, status metav1.ConditionStatus, reason ConditionReason, ...) Condition
- func TrueCondition(t ConditionType, reason ConditionReason, message string) Condition
- func UnknownCondition(t ConditionType, reason ConditionReason, message string) Condition
- type ConditionReason
- type ConditionType
- type StatusConditions
- func (in *StatusConditions) DeepCopy() *StatusConditions
- func (in *StatusConditions) DeepCopyInto(out *StatusConditions)
- func (sc *StatusConditions) GetConditionByType(conditionType ConditionType) *Condition
- func (sc *StatusConditions) IsReadyTrue() bool
- func (sc *StatusConditions) SetConditions(conditionsToSet ...Condition)
Constants ¶
const ( // ReadyCondition reflects the overall readiness status of a resource. ReadyCondition ConditionType = "Ready" // DeleteCondition reflects that the resource has finished its cleanup process. DeleteCondition ConditionType = "Delete" // ClusterListEmpty is set when the resources ClusterSelector results in an empty ClusterList. ClusterListEmpty ConditionType = "ClusterListEmpty" // OwnerLabelSetCondition reflects that the resource has the owned-by label set to an existing support-group Team. OwnerLabelSetCondition ConditionType = "OwnerLabelSet" // OwnerLabelMissingReason is set when the resource is missing the owned-by label. OwnerLabelMissingReason ConditionReason = "OwnerLabelMissing" // OwnerLabelSetToNotExistingTeamReason is set when the resource has the owned-by label set to a non-existing Team. OwnerLabelSetToNotExistingTeamReason ConditionReason = "OwnerLabelNotExistingTeam" // OwnerLabelSetToNonSupportGroupTeamReason is set when the resource has the owned-by label set to a non-support-group Team. OwnerLabelSetToNonSupportGroupTeamReason ConditionReason = "OwnerLabelSetToNonSupportGroupTeam" )
Common condition types and reasons used across Greenhouse resources.
const ( // FailedEvent is used if the resource reconciliation failed FailedEvent = "Failed" // SuccessfulDeletedEvent is used if the resource was deleted successfully SuccessfulDeletedEvent = "SuccessfulDeleted" // FailedDeleteEvent is used if delete failed FailedDeleteEvent = "FailedDelete" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
// Type of the condition.
Type ConditionType `json:"type"`
// Status of the condition.
Status metav1.ConditionStatus `json:"status"`
// Reason is a one-word, CamelCase reason for the condition's last transition.
Reason ConditionReason `json:"reason,omitempty"`
// LastTransitionTime is the last time the condition transitioned from one status to another.
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
// Message is an optional human-readable message indicating details about the last transition.
Message string `json:"message,omitempty"`
}
Condition contains additional information on the state of a resource.
func FalseCondition ¶
func FalseCondition(t ConditionType, reason ConditionReason, message string) Condition
FalseCondition returns a Condition with ConditionFalse and the given type, reason and message. LastTransitionTime is set to now.
func NewCondition ¶
func NewCondition(condition ConditionType, status metav1.ConditionStatus, reason ConditionReason, message string) Condition
NewCondition returns a Condition with the given type, status, reason and message. LastTransitionTime is set to now.
func TrueCondition ¶
func TrueCondition(t ConditionType, reason ConditionReason, message string) Condition
TrueCondition returns a Condition with ConditionTrue and the given type, reason and message. LastTransitionTime is set to now.
func UnknownCondition ¶
func UnknownCondition(t ConditionType, reason ConditionReason, message string) Condition
UnknownCondition returns a Condition with ConditionUnknown and the given type, reason and message. LastTransitionTime is set to now.
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Condition) Equal ¶
Equal returns true if the condition is identical to the supplied condition, ignoring the LastTransitionTime.
type ConditionReason ¶
type ConditionReason string
ConditionReason is a valid reason for a condition of a resource.
type StatusConditions ¶
type StatusConditions struct {
// +listType="map"
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty"`
}
A StatusConditions contains a list of conditions. Only one condition of a given type may exist in the list.
func (*StatusConditions) DeepCopy ¶
func (in *StatusConditions) DeepCopy() *StatusConditions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusConditions.
func (*StatusConditions) DeepCopyInto ¶
func (in *StatusConditions) DeepCopyInto(out *StatusConditions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*StatusConditions) GetConditionByType ¶
func (sc *StatusConditions) GetConditionByType(conditionType ConditionType) *Condition
GetConditionByType returns the condition of the given type, if it exists.
func (*StatusConditions) IsReadyTrue ¶
func (sc *StatusConditions) IsReadyTrue() bool
IsReadyTrue returns true if the Ready condition is true.
func (*StatusConditions) SetConditions ¶
func (sc *StatusConditions) SetConditions(conditionsToSet ...Condition)
SetConditions sets the corresponding Conditions in StatusConditions to newConditions. If the LastTransitionTime of a new Condition is not set, it is set to the current time. If a Condition of the same ConditionType exists, it is updated. The LastTransitionTime is only updated if the Status changes. If a condition of the same ConditionType does not exist, it is appended.