Skip to content

Commit

Permalink
fix: set resource version to 1 on old (#2385) (#2386)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6a91c81)

Co-authored-by: Fabian Kramm <[email protected]>
  • Loading branch information
loft-bot and FabianKramm authored Jan 9, 2025
1 parent 8433175 commit c55fcea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _default:

# Build the vcluster binary
build-snapshot:
TELEMETRY_PRIVATE_KEY="" goreleaser build --snapshot --clean --single-target
TELEMETRY_PRIVATE_KEY="" goreleaser build --id vcluster --snapshot --clean

# Build the vcluster release binary in snapshot mode
release-snapshot: gen-license-report
Expand Down
7 changes: 7 additions & 0 deletions pkg/syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ func (r *SyncController) Reconcile(ctx context.Context, vReq reconcile.Request)
}
}()

// debug log request
klog.FromContext(ctx).V(1).Info("Reconcile started")
defer func() {
klog.FromContext(ctx).V(1).Info("Reconcile ended")
}()

// check if we should skip reconcile
lifecycle, ok := r.syncer.(syncertypes.Starter)
if ok {
Expand Down Expand Up @@ -272,6 +278,7 @@ func (r *SyncController) getObjects(ctx *synccontext.SyncContext, vReq, pReq ctr
// from virtual to host correctly.
vObjOld = vObj.DeepCopyObject().(client.Object)
vObjOld.SetLabels(nil)
vObjOld.SetResourceVersion("1")

// only add to cache if it's not deleting
if vObj.GetDeletionTimestamp() == nil {
Expand Down

0 comments on commit c55fcea

Please sign in to comment.