Skip to content

Commit

Permalink
Merge pull request #1256 from loft-sh/fix/node-syncer-not-requeuing
Browse files Browse the repository at this point in the history
Fixed node-syncer not requeuing after status update
  • Loading branch information
Thomas Kosiewski authored Sep 29, 2023
2 parents 7e7d9e4 + 7dd6b42 commit c1b5595
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/controllers/resources/nodes/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ func (s *nodeSyncer) Sync(ctx *synccontext.SyncContext, pObj client.Object, vObj
return ctrl.Result{}, err
}

// we will requeue here anyways
return ctrl.Result{}, nil
vNode = updatedVNode
}

updated := s.translateUpdateBackwards(pNode, vNode)
Expand Down
9 changes: 9 additions & 0 deletions pkg/controllers/resources/nodes/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ func TestSync(t *testing.T) {
editedNode = &corev1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: baseName.Name,
Annotations: map[string]string{
translate.ManagedLabelsAnnotation: "test",
},
Labels: map[string]string{
"test": "true",
},
Expand Down Expand Up @@ -473,6 +476,9 @@ func TestSync(t *testing.T) {
editedNode = &corev1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: baseName.Name,
Annotations: map[string]string{
translate.ManagedLabelsAnnotation: "test",
},
Labels: map[string]string{
"test": "true",
},
Expand Down Expand Up @@ -517,6 +523,9 @@ func TestSync(t *testing.T) {
editedNode = &corev1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: baseName.Name,
Annotations: map[string]string{
translate.ManagedLabelsAnnotation: "test",
},
Labels: map[string]string{
"test": "true",
},
Expand Down

0 comments on commit c1b5595

Please sign in to comment.