Documentation ¶
Index ¶
- Constants
- Variables
- func AddOwnershipIndex(ctx context.Context, fieldIndexes client.FieldIndexer, ...) error
- func ClearStaleConditions(conditions *[]metav1.Condition, currentGeneration int64)
- func GetCondition(conditions []metav1.Condition, conditionType string) *metav1.Condition
- func GetConditionMessage(conditions []metav1.Condition, conditionType string) string
- func GetConditionReason(conditions []metav1.Condition, conditionType string) string
- func GetConditionStatus(conditions []metav1.Condition, conditionType string) *metav1.ConditionStatus
- func GetStatusOfType[T any](o client.Object) (T, bool)
- func HasCondition(conditions []metav1.Condition, conditionType string) bool
- func IndexGetOwnerReferencesOf(obj client.Object) []string
- func IsConditionStatusOneOf(conditions []metav1.Condition, conditionType string, ...) bool
- func MustGetStatusOfType[T any](o client.Object) T
- func NewReconciliation[O client.Object](ctx context.Context, c client.Client, req ctrl.Request, object O, ...) (*Reconciliation[O], *Result)
- func OwnedBy(scheme *runtime.Scheme, owner client.Object) client.ListOption
- func RemoveConditionIfReasonIsOneOf(conditions *[]metav1.Condition, conditionType string, reasons ...string) bool
- func SetCondition(conditions *[]metav1.Condition, conditionType string, ...) bool
- func SetConditionsGenerationAndTransitionTime(conditions []metav1.Condition, generation int64)
- type CommonCondition
- type ConditionsProvider
- type ControlleeObjectStatus
- type FinalizingObjectStatus
- type InitializableObjectStatus
- type Reconciliation
- type Result
Constants ¶
View Source
const (
OwnershipIndexField = "metadata.ownerReference"
)
View Source
const StatusFieldName = "Status"
Variables ¶
View Source
var ( CommonConditionReasons = map[string]CommonCondition{ "Finalizing": {RemovalVerb: "Finalized", Reasons: []string{"FinalizationFailed", "FinalizerRemovalFailed", "InProgress"}}, "FailedToInitialize": {RemovalVerb: "Initialized", Reasons: []string{"InternalError"}}, "Invalid": {RemovalVerb: "Valid", Reasons: []string{"ControllerNotAccessible", "ControllerNotFound", "ControllerReferenceMissing", "InternalError"}}, } )
Functions ¶
func AddOwnershipIndex ¶
func ClearStaleConditions ¶
func GetCondition ¶
func GetConditionMessage ¶
func GetConditionReason ¶
func GetConditionStatus ¶
func GetConditionStatus(conditions []metav1.Condition, conditionType string) *metav1.ConditionStatus
func IsConditionStatusOneOf ¶
func MustGetStatusOfType ¶
func NewReconciliation ¶
func SetCondition ¶
Types ¶
type CommonCondition ¶
type ConditionsProvider ¶
type ControlleeObjectStatus ¶
type ControlleeObjectStatus interface { SetInvalidDueToControllerNotAccessible(message string, args ...interface{}) bool SetInvalidDueToControllerNotFound(message string, args ...interface{}) bool SetInvalidDueToControllerReferenceMissing(message string, args ...interface{}) bool SetInvalidDueToInternalError(message string, args ...interface{}) bool SetValidIfInvalidDueToAnyOf(reason ...string) bool }
type FinalizingObjectStatus ¶
type FinalizingObjectStatus interface { IsFinalizing() bool SetFinalizingDueToFinalizationFailed(message string, args ...interface{}) bool SetFinalizingDueToFinalizerRemovalFailed(message string, args ...interface{}) bool SetFinalizingDueToInProgress(message string, args ...interface{}) bool SetFinalizedIfFinalizingDueToAnyOf(reason ...string) bool }
type Reconciliation ¶
type Reconciliation[O client.Object] struct { Ctx context.Context Client client.Client Object O // contains filtered or unexported fields }
func (*Reconciliation[O]) FinalizeObjectIfDeleted ¶
func (r *Reconciliation[O]) FinalizeObjectIfDeleted() *Result
func (*Reconciliation[O]) GetRequiredController ¶
func (r *Reconciliation[O]) GetRequiredController(controller client.Object) *Result
func (*Reconciliation[O]) InitializeObject ¶
func (r *Reconciliation[O]) InitializeObject() *Result
func (*Reconciliation[O]) UpdateStatus ¶
func (r *Reconciliation[O]) UpdateStatus() *Result
type Result ¶
func DoNotRequeue ¶
func DoNotRequeue() *Result
func RequeueAfter ¶
func RequeueDueToError ¶
Click to show internal directories.
Click to hide internal directories.