diff --git a/pkg/controllers/resources/nodes/syncer_test.go b/pkg/controllers/resources/nodes/syncer_test.go index 5c5a315a8..2539ac7cc 100644 --- a/pkg/controllers/resources/nodes/syncer_test.go +++ b/pkg/controllers/resources/nodes/syncer_test.go @@ -304,12 +304,14 @@ func TestSyncBothExist(t *testing.T) { } if tC.virtualNodeExists { - node := initialVNode.DeepCopy() if len(tC.virtualInitialAnnotations) > 0 { - node.Annotations = tC.virtualInitialAnnotations + // Since we pass initialVNode to syncer.Sync, we should + // update the initialVNode to have annnotations as per + // the test case + initialVNode.Annotations = tC.virtualInitialAnnotations } - initialObjects = append(initialObjects, node) + initialObjects = append(initialObjects, initialVNode) } physical.Labels = tC.hostLabel