Skip to content

Commit

Permalink
Revert "feat: refact updateStatusConditionIfNotMatch for both RAG and…
Browse files Browse the repository at this point in the history
… workspace (#626)"

This reverts commit 152e683.

Signed-off-by: Bangqi Zhu <bangqizhu@microsoft.com>
  • Loading branch information
Bangqi Zhu committed Oct 17, 2024
1 parent 6481b76 commit 65382b1
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 101 deletions.
2 changes: 1 addition & 1 deletion pkg/controllers/ragengine_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ func (c *RAGEngineReconciler) updateStatusConditionIfNotMatch(ctx context.Contex
ObservedGeneration: ragObj.GetGeneration(),
Message: cMessage,
}
return updateObjStatus(ctx, c.Client, &client.ObjectKey{Name: ragObj.Name, Namespace: ragObj.Namespace}, "ragengine", &cObj, nil)
return updateObjStatus(ctx, c.Client, &client.ObjectKey{Name: ragObj.Name, Namespace: ragObj.Namespace}, "RAGEngine", &cObj, nil)
}
6 changes: 3 additions & 3 deletions pkg/controllers/ragengine_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestUpdateRAGEngineStatus(t *testing.T) {
mockClient.On("Get", mock.IsType(context.Background()), mock.Anything, mock.IsType(&kaitov1alpha1.RAGEngine{}), mock.Anything).Return(nil)
mockClient.StatusMock.On("Update", mock.IsType(context.Background()), mock.IsType(&kaitov1alpha1.RAGEngine{}), mock.Anything).Return(nil)

err := updateObjStatus(ctx, reconciler.Client, &client.ObjectKey{Name: ragengine.Name, Namespace: ragengine.Namespace}, "ragengine", &condition, workerNodes)
err := updateObjStatus(ctx, reconciler.Client, &client.ObjectKey{Name: ragengine.Name, Namespace: ragengine.Namespace}, "RAGEngine", &condition, workerNodes)
assert.Nil(t, err)
})

Expand All @@ -60,7 +60,7 @@ func TestUpdateRAGEngineStatus(t *testing.T) {

mockClient.On("Get", mock.IsType(context.Background()), mock.Anything, mock.IsType(&kaitov1alpha1.RAGEngine{}), mock.Anything).Return(errors.New("Get operation failed"))

err := updateObjStatus(ctx, reconciler.Client, &client.ObjectKey{Name: ragengine.Name, Namespace: ragengine.Namespace}, "ragengine", &condition, workerNodes)
err := updateObjStatus(ctx, reconciler.Client, &client.ObjectKey{Name: ragengine.Name, Namespace: ragengine.Namespace}, "RAGEngine", &condition, workerNodes)
assert.NotNil(t, err)
})

Expand All @@ -82,7 +82,7 @@ func TestUpdateRAGEngineStatus(t *testing.T) {

mockClient.On("Get", mock.IsType(context.Background()), mock.Anything, mock.IsType(&kaitov1alpha1.RAGEngine{}), mock.Anything).Return(apierrors.NewNotFound(schema.GroupResource{}, "ragengine"))

err := updateObjStatus(ctx, reconciler.Client, &client.ObjectKey{Name: ragengine.Name, Namespace: ragengine.Namespace}, "ragengine", &condition, workerNodes)
err := updateObjStatus(ctx, reconciler.Client, &client.ObjectKey{Name: ragengine.Name, Namespace: ragengine.Namespace}, "RAGEngine", &condition, workerNodes)
assert.Nil(t, err)
})
}
Expand Down
Loading

0 comments on commit 65382b1

Please sign in to comment.