Skip to content

Commit

Permalink
fix: node unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Jul 18, 2024
1 parent e109d51 commit b13c8e1
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 164 deletions.
10 changes: 2 additions & 8 deletions pkg/controllers/resources/nodes/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,28 +269,22 @@ func (s *nodeSyncer) Sync(ctx *synccontext.SyncContext, pObj client.Object, vObj
return ctrl.Result{}, ctx.VirtualClient.Delete(ctx, vObj)
}

withoutLabels := pNode.DeepCopy()

patch, err := patcher.NewSyncerPatcher(ctx, withoutLabels, vNode)
patch, err := patcher.NewSyncerPatcher(ctx, pNode, vNode)
if err != nil {
return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err)
}
defer func() {
fmt.Println("vnode : ", vNode.Labels)
fmt.Println("pnode : ", pNode.Labels)
if err := patch.Patch(ctx, pNode, vNode); err != nil {
retErr = utilerrors.NewAggregate([]error{retErr, err})
}
}()

updatedVNode, _, err := s.translateUpdateStatus(ctx, pNode, vNode)
err = s.translateUpdateStatus(ctx, pNode, vNode)
if err != nil {
return ctrl.Result{}, fmt.Errorf("update node status: %w", err)
}
vNode.Status = updatedVNode.Status

s.translateUpdateBackwards(pNode, vNode)

return ctrl.Result{}, nil
}

Expand Down
Loading

0 comments on commit b13c8e1

Please sign in to comment.