Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions synccontrols/sync_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ func NewRealSyncControl(reconcileMixIn *mixin.ReconcilerMixin,
ResourceContextControl: resourceContexts,
Recorder: reconcileMixIn.Recorder,

scaleInLifecycleAdapter: scaleInOpsLifecycleAdapter,
updateLifecycleAdapter: updateLifecycleAdapter,
ScaleInLifecycleAdapter: scaleInOpsLifecycleAdapter,
UpdateLifecycleAdapter: updateLifecycleAdapter,
CacheExpectations: cacheExpectations,
TargetGVK: targetGVK,
}
Expand Down
12 changes: 6 additions & 6 deletions synccontrols/x_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ type UpdateConfig struct {
ResourceContextControl resourcecontexts.ResourceContextControl
Recorder record.EventRecorder

scaleInLifecycleAdapter api.LifecycleAdapter
updateLifecycleAdapter api.LifecycleAdapter
ScaleInLifecycleAdapter api.LifecycleAdapter
UpdateLifecycleAdapter api.LifecycleAdapter

CacheExpectations expectations.CacheExpectationsInterface
TargetGVK schema.GroupVersionKind
Expand All @@ -336,7 +336,7 @@ var NewInPlaceOnlyPossibleUpdaterFunc func() TargetUpdater

// RegisterInPlaceOnlyUpdater Support users to define inPlaceOnlyTargetUpdater and register through RegisterInPlaceOnlyUpdater
func RegisterInPlaceOnlyUpdater(f func() TargetUpdater) {
NewInPlaceIfPossibleUpdaterFunc = f
NewInPlaceOnlyPossibleUpdaterFunc = f
}

var NewInPlaceIfPossibleUpdaterFunc func() TargetUpdater
Expand Down Expand Up @@ -392,7 +392,7 @@ func (u *GenericTargetUpdater) BeginUpdateTarget(ctx context.Context, syncContex
targetInfo := <-targetCh
u.Recorder.Eventf(targetInfo.Object, corev1.EventTypeNormal, "TargetUpdateLifecycle", "try to begin TargetOpsLifecycle for updating Target of XSet")

if updated, err := opslifecycle.BeginWithCleaningOld(ctx, u.XsetLabelAnnoMgr, u.Client, u.updateLifecycleAdapter, targetInfo.Object, func(obj client.Object) (bool, error) {
if updated, err := opslifecycle.BeginWithCleaningOld(ctx, u.XsetLabelAnnoMgr, u.Client, u.UpdateLifecycleAdapter, targetInfo.Object, func(obj client.Object) (bool, error) {
if !targetInfo.OnlyMetadataChanged && !targetInfo.InPlaceUpdateSupport {
return opslifecycle.WhenBeginDelete(u.XsetLabelAnnoMgr, obj)
}
Expand Down Expand Up @@ -489,11 +489,11 @@ func (u *GenericTargetUpdater) FilterAllowOpsTargets(ctx context.Context, candid
func (u *GenericTargetUpdater) FinishUpdateTarget(ctx context.Context, targetInfo *TargetUpdateInfo, finishByCancelUpdate bool) error {
if finishByCancelUpdate {
// cancel update lifecycle
return opslifecycle.CancelOpsLifecycle(ctx, u.XsetLabelAnnoMgr, u.Client, u.updateLifecycleAdapter, targetInfo.Object)
return opslifecycle.CancelOpsLifecycle(ctx, u.XsetLabelAnnoMgr, u.Client, u.UpdateLifecycleAdapter, targetInfo.Object)
}

// target is ops finished, finish the lifecycle gracefully
if updated, err := opslifecycle.Finish(ctx, u.XsetLabelAnnoMgr, u.Client, u.updateLifecycleAdapter, targetInfo.Object); err != nil {
if updated, err := opslifecycle.Finish(ctx, u.XsetLabelAnnoMgr, u.Client, u.UpdateLifecycleAdapter, targetInfo.Object); err != nil {
return fmt.Errorf("failed to finish TargetOpsLifecycle for updating Target %s/%s: %w", targetInfo.GetNamespace(), targetInfo.GetName(), err)
} else if updated {
// add an expectation for this target update, before next reconciling
Expand Down
Loading