Documentation ¶
Index ¶
- Constants
- func AddDynamicCacheLabel(ctx context.Context, w client.Writer, obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func DeleteMappedConditions(_ context.Context, conditions *[]metav1.Condition)
- func EnsureCachedFinalizer(ctx context.Context, c client.Client, obj client.Object) error
- func EnsureFinalizer(ctx context.Context, c client.Client, obj client.Object, finalizer string) error
- func FreeCacheAndRemoveFinalizer(ctx context.Context, c client.Client, obj client.Object, cache cacheFreer) error
- func GetControllerOf(_ context.Context, scheme *runtime.Scheme, ownerStrategy isControllerChecker, ...) ([]corev1alpha1.ControlledObjectReference, error)
- func IsAdoptionRefusedError(err error) bool
- func IsExternalResourceNotFound(err error) bool
- func IsMappedCondition(cond metav1.Condition) bool
- func MapConditions(_ context.Context, srcGeneration int64, srcConditions []metav1.Condition, ...)
- func RemoveDynamicCacheLabel(ctx context.Context, w client.Writer, obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func RemoveFinalizer(ctx context.Context, c client.Client, obj client.Object, finalizer string) error
- func UpdateObjectSetOrPhaseStatusFromError(ctx context.Context, objectSetOrPhase ObjectSetOrPhase, reconcileErr error, ...) (res ctrl.Result, err error)
- type BackoffConfig
- type BackoffOption
- type CommonObjectPhaseError
- type ControllerError
- type ErrorReason
- type ObjectNotOwnedByPreviousRevisionError
- type ObjectSetOrPhase
- type PhaseObjectOwner
- type PhaseReconciler
- type PhaseReconcilerError
- type PreviousObjectSet
- type PreviousObjectSetFactory
- type PreviousOwner
- type PreviousRevisionLookup
- type ProbingResult
- type RevisionCollisionError
- type WithInitialBackoff
- type WithMaxBackoff
Constants ¶
const ( // Use this delay if you want to retry an invalid user configuration. // e.g.: // - referencing objects that don't exist. // - object collisions. // - missing permissions. DefaultGlobalMissConfigurationRetry = 30 * time.Second DefaultInitialBackoff = 10 * time.Second DefaultMaxBackoff = 300 * time.Second )
const ( // This label is set on all dynamic objects to limit caches. DynamicCacheLabel = "package-operator.run/cache" // Common finalizer to free allocated caches when objects are deleted. CachedFinalizer = "package-operator.run/cached" // Records cause of change for history keeping. ChangeCauseAnnotation = "kubernetes.io/change-cause" // Causes PKO to skip ownership checks, used during self-bootstrap. ForceAdoptionEnvironmentVariable = "PKO_FORCE_ADOPTION" // Name of the PKO field manager for server-side apply. FieldOwner = "package-operator" )
Variables ¶
This section is empty.
Functions ¶
func AddDynamicCacheLabel ¶
func AddDynamicCacheLabel( ctx context.Context, w client.Writer, obj *unstructured.Unstructured, ) (*unstructured.Unstructured, error)
AddDynamicCacheLabel ensures that the given object is labeled for recognition by the dynamic cache.
func DeleteMappedConditions ¶
func EnsureCachedFinalizer ¶
func EnsureFinalizer ¶
func EnsureFinalizer( ctx context.Context, c client.Client, obj client.Object, finalizer string, ) error
Ensures the given finalizer is set and persisted on the given object.
func FreeCacheAndRemoveFinalizer ¶
func FreeCacheAndRemoveFinalizer( ctx context.Context, c client.Client, obj client.Object, cache cacheFreer, ) error
Frees caches and removes the associated finalizer.
func GetControllerOf ¶
func GetControllerOf( _ context.Context, scheme *runtime.Scheme, ownerStrategy isControllerChecker, owner client.Object, actualObjects []client.Object, ) ([]corev1alpha1.ControlledObjectReference, error)
Returns a list of ControlledObjectReferences controlled by this instance.
func IsAdoptionRefusedError ¶
Returns true if the underlying error is because adoption has been refused.
func IsMappedCondition ¶
func MapConditions ¶
func RemoveDynamicCacheLabel ¶
func RemoveDynamicCacheLabel( ctx context.Context, w client.Writer, obj *unstructured.Unstructured, ) (*unstructured.Unstructured, error)
Types ¶
type BackoffConfig ¶
func (*BackoffConfig) Default ¶
func (c *BackoffConfig) Default()
func (*BackoffConfig) GetBackoff ¶
func (c *BackoffConfig) GetBackoff() *flowcontrol.Backoff
func (*BackoffConfig) Option ¶
func (c *BackoffConfig) Option(opts ...BackoffOption)
type BackoffOption ¶
type BackoffOption interface {
ConfigureBackoff(*BackoffConfig)
}
type CommonObjectPhaseError ¶
type CommonObjectPhaseError struct {
OwnerKey, ObjectKey client.ObjectKey
OwnerGVK, ObjectGVK schema.GroupVersionKind
}
type ControllerError ¶
type ControllerError interface {
CausedBy(reason ErrorReason) bool
}
type ErrorReason ¶
type ErrorReason string
const (
ErrorReasonExternalResourceNotFound ErrorReason = "external resource not found"
)
func (ErrorReason) String ¶
func (r ErrorReason) String() string
type ObjectNotOwnedByPreviousRevisionError ¶
type ObjectNotOwnedByPreviousRevisionError struct {
CommonObjectPhaseError
}
This error is returned when a Phase contains objects that are not owned by a previous revision. Previous revisions of an Phase have to be declared in .spec.previousRevisions.
func (*ObjectNotOwnedByPreviousRevisionError) Error ¶
func (e *ObjectNotOwnedByPreviousRevisionError) Error() string
type ObjectSetOrPhase ¶
type PhaseObjectOwner ¶
type PhaseReconciler ¶
type PhaseReconciler struct {
// contains filtered or unexported fields
}
PhaseReconciler reconciles objects within a ObjectSet phase.
func NewPhaseReconciler ¶
func (*PhaseReconciler) ReconcilePhase ¶
func (r *PhaseReconciler) ReconcilePhase( ctx context.Context, owner PhaseObjectOwner, phase corev1alpha1.ObjectSetTemplatePhase, probe probing.Prober, previous []PreviousObjectSet, ) (actualObjects []client.Object, res ProbingResult, err error)
func (*PhaseReconciler) TeardownPhase ¶
func (r *PhaseReconciler) TeardownPhase( ctx context.Context, owner PhaseObjectOwner, phase corev1alpha1.ObjectSetTemplatePhase, ) (cleanupDone bool, err error)
type PhaseReconcilerError ¶
type PhaseReconcilerError struct {
// contains filtered or unexported fields
}
func NewExternalResourceNotFoundError ¶
func NewExternalResourceNotFoundError(rsrc client.Object) *PhaseReconcilerError
func (*PhaseReconcilerError) CausedBy ¶
func (e *PhaseReconcilerError) CausedBy(reason ErrorReason) bool
func (*PhaseReconcilerError) Error ¶
func (e *PhaseReconcilerError) Error() string
type PreviousObjectSet ¶
type PreviousObjectSet interface { ClientObject() client.Object GetRemotePhases() []corev1alpha1.RemotePhaseReference }
type PreviousObjectSetFactory ¶
type PreviousObjectSetFactory func(*runtime.Scheme) PreviousObjectSet
type PreviousOwner ¶
type PreviousOwner interface { ClientObject() client.Object GetPrevious() []corev1alpha1.PreviousRevisionReference }
type PreviousRevisionLookup ¶
type PreviousRevisionLookup struct {
// contains filtered or unexported fields
}
func NewPreviousRevisionLookup ¶
func NewPreviousRevisionLookup( scheme *runtime.Scheme, newPreviousObjectSet PreviousObjectSetFactory, client client.Reader, ) *PreviousRevisionLookup
func (*PreviousRevisionLookup) Lookup ¶
func (l *PreviousRevisionLookup) Lookup( ctx context.Context, owner PreviousOwner, ) ([]PreviousObjectSet, error)
type ProbingResult ¶
func (*ProbingResult) IsZero ¶
func (e *ProbingResult) IsZero() bool
func (*ProbingResult) String ¶
func (e *ProbingResult) String() string
func (*ProbingResult) StringWithoutPhase ¶
func (e *ProbingResult) StringWithoutPhase() string
type RevisionCollisionError ¶
type RevisionCollisionError struct {
CommonObjectPhaseError
}
This error is returned when a Phase tries to adopt an object where the revision number is not increasing.
func (*RevisionCollisionError) Error ¶
func (e *RevisionCollisionError) Error() string
type WithInitialBackoff ¶
func (WithInitialBackoff) ConfigureBackoff ¶
func (w WithInitialBackoff) ConfigureBackoff(c *BackoffConfig)
type WithMaxBackoff ¶
func (WithMaxBackoff) ConfigureBackoff ¶
func (w WithMaxBackoff) ConfigureBackoff(c *BackoffConfig)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
hypershift/v1beta1
The package v1beta1 contains some API Schema definitions for the v1beta1 version of some Hypershift API group.
|
The package v1beta1 contains some API Schema definitions for the v1beta1 version of some Hypershift API group. |