Documentation ¶
Index ¶
- Constants
- func CleanUpResources(old, new *status.Resources, c client.Client, ns string) error
- func Record(owner runtime.Object, recorder record.EventRecorder, result syncer.SyncResult) error
- func SyncComponent(ctx context.Context, r interfaces.Reconcile, m application.ComponentMutate, ...) (resources status.Resources, err error)
- func SyncComponents(ctx context.Context, r interfaces.Reconcile, ...) (appStatus status.ApplicationStatus, err error)
- func SyncObject(ctx context.Context, r interfaces.Reconcile, syncer syncer.Interface) (status.ObjectStatus, error)
- func SyncObjects(ctx context.Context, r interfaces.Reconcile, syncers map[int]syncer.Interface) (resources status.Resources, err error)
- func WaitUntilCompletion(r interfaces.Reconcile, obj runtime.Object) error
- type ComponentReconciler
- type InstanceReconciler
- type ReconcilerBase
- func (r *ReconcilerBase) GetClient() client.Client
- func (r *ReconcilerBase) GetRecorder() record.EventRecorder
- func (r *ReconcilerBase) GetRestConfig() *rest.Config
- func (r *ReconcilerBase) GetScheme() *runtime.Scheme
- func (r *ReconcilerBase) IsInitialized(obj metav1.Object) bool
- func (r *ReconcilerBase) IsValid(obj metav1.Object) (bool, error)
- func (r *ReconcilerBase) Reconcile(request reconcile.Request) (reconcile.Result, error)
- type ResourceReconciler
Constants ¶
View Source
const ( RetryInterval = 50 * time.Millisecond RetryTimeout = 2 * time.Second // ReadinessTimeout = 30 * time.Second ReadinessTimeout = 5 * time.Minute GCTimeout = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func CleanUpResources ¶
func Record ¶
func Record(owner runtime.Object, recorder record.EventRecorder, result syncer.SyncResult) error
func SyncComponent ¶
func SyncComponent(ctx context.Context, r interfaces.Reconcile, m application.ComponentMutate, owner interfaces.Object) (resources status.Resources, err error)
func SyncComponents ¶
func SyncComponents(ctx context.Context, r interfaces.Reconcile, cpts map[string]application.ComponentMutate, owner interfaces.Object, order map[int]string) (appStatus status.ApplicationStatus, err error)
func SyncObject ¶
func SyncObject(ctx context.Context, r interfaces.Reconcile, syncer syncer.Interface) (status.ObjectStatus, error)
func SyncObjects ¶
func WaitUntilCompletion ¶
func WaitUntilCompletion(r interfaces.Reconcile, obj runtime.Object) error
Types ¶
type ComponentReconciler ¶
type ComponentReconciler struct { ReconcilerBase *ReconcilerBase Component application.Component Status status.ComponentStatus Owner interfaces.Object // contains filtered or unexported fields }
type InstanceReconciler ¶
type InstanceReconciler struct { *ReconcilerBase Instance application.Instance SyncOrder map[int]string }
func NewInstanceReconciler ¶
func NewInstanceReconciler(r *ReconcilerBase, i application.Instance, order map[int]string) *InstanceReconciler
func (*InstanceReconciler) ManageError ¶
func (r *InstanceReconciler) ManageError(owner status.ObjectWithStatus) (reconcile.Result, error)
func (er *InstanceReconciler) ManageSuccess(instance apis.Resource) (reconcile.Result, error) { if enforcingReconcileStatusAware, updateStatus := (instance).(apis.EnforcingReconcileStatusAware); updateStatus { condition := status.Condition{ Type: "ReconcileSuccess", LastTransitionTime: metav1.Now(), Message: astatus.SuccessfulMessage, Reason: astatus.SuccessfulReason, Status: corev1.ConditionTrue, } status := apis.EnforcingReconcileStatus{ Conditions: status.NewConditions(condition), LockedResourceStatuses: er.GetLockedResourceStatuses(instance), LockedPatchStatuses: er.GetLockedPatchStatuses(instance), } enforcingReconcileStatusAware.SetEnforcingReconcileStatus(status) log.V(1).Info("about to modify state for", "instance version", instance.GetResourceVersion()) err := er.GetClient().Status().Update(context.Background(), instance) if err != nil { if errors.IsResourceExpired(err) { log.Info("unable to update status for", "object version", instance.GetResourceVersion(), "resource version expired, will trigger another reconcile cycle", "") } else { log.Error(err, "unable to update status for", "object", instance) } return reconcile.Result{}, err } } else { log.V(1).Info("object is not RecocileStatusAware, not setting status") } return reconcile.Result{}, nil }
type ReconcilerBase ¶
type ReconcilerBase struct {
// contains filtered or unexported fields
}
func NewReconcilerBase ¶
func NewReconcilerBase(client client.Client, scheme *runtime.Scheme, restConfig *rest.Config, recorder record.EventRecorder) ReconcilerBase
func (*ReconcilerBase) GetClient ¶
func (r *ReconcilerBase) GetClient() client.Client
GetClient returns the underlying client
func (*ReconcilerBase) GetRecorder ¶
func (r *ReconcilerBase) GetRecorder() record.EventRecorder
GetRecorder returns the underlying recorder
func (*ReconcilerBase) GetRestConfig ¶
func (r *ReconcilerBase) GetRestConfig() *rest.Config
GetRestConfig returns the undelying rest config
func (*ReconcilerBase) GetScheme ¶
func (r *ReconcilerBase) GetScheme() *runtime.Scheme
GetScheme returns the scheme
func (*ReconcilerBase) IsInitialized ¶
func (r *ReconcilerBase) IsInitialized(obj metav1.Object) bool
IsInitialized determines if a CR instance is initialized. this implementation returns always true, should be overridden
type ResourceReconciler ¶
type ResourceReconciler struct { *ReconcilerBase Object objects.Object Owner interfaces.Object Status status.ObjectStatus // contains filtered or unexported fields }
func NewResourceReconciler ¶
func NewResourceReconciler(r *ReconcilerBase, o objects.Object, owner interfaces.Object, ctx context.Context) *ResourceReconciler
Click to show internal directories.
Click to hide internal directories.