Skip to content

Commit e5af0d2

Browse files
committed
Fix linting issues
1 parent 5800384 commit e5af0d2

2 files changed

Lines changed: 19 additions & 20 deletions

File tree

cmd/thv-operator/controllers/embeddingserver_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (r *EmbeddingServerReconciler) ensureStatefulSet(
215215
"StatefulSet.Name", statefulSet.Name)
216216
return ctrl.Result{}, true, err
217217
}
218-
return ctrl.Result{Requeue: true}, true, nil
218+
return ctrl.Result{RequeueAfter: time.Second}, true, nil
219219
}
220220

221221
// Check if the statefulset spec changed
@@ -228,7 +228,7 @@ func (r *EmbeddingServerReconciler) ensureStatefulSet(
228228
"StatefulSet.Name", statefulSet.Name)
229229
return ctrl.Result{}, true, err
230230
}
231-
return ctrl.Result{Requeue: true}, true, nil
231+
return ctrl.Result{RequeueAfter: time.Second}, true, nil
232232
}
233233

234234
return ctrl.Result{}, false, nil

cmd/thv-operator/controllers/embeddingserver_controller_test.go

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,11 @@ func TestStatefulSetNeedsUpdate(t *testing.T) {
525525
t.Parallel()
526526

527527
tests := []struct {
528-
name string
529-
embedding *mcpv1alpha1.EmbeddingServer
530-
existingSts *appsv1.StatefulSet
531-
expectedUpdate bool
532-
updateReason string
528+
name string
529+
embedding *mcpv1alpha1.EmbeddingServer
530+
existingSts *appsv1.StatefulSet
531+
expectedUpdate bool
532+
updateReason string
533533
}{
534534
{
535535
name: "no update needed - identical",
@@ -668,11 +668,11 @@ func TestHandleDeletion(t *testing.T) {
668668
t.Parallel()
669669

670670
tests := []struct {
671-
name string
672-
embedding *mcpv1alpha1.EmbeddingServer
673-
expectDone bool
674-
expectError bool
675-
expectFinalizer bool
671+
name string
672+
embedding *mcpv1alpha1.EmbeddingServer
673+
expectDone bool
674+
expectError bool
675+
expectFinalizer bool
676676
}{
677677
{
678678
name: "not being deleted",
@@ -768,12 +768,12 @@ func TestEnsureStatefulSet(t *testing.T) {
768768
t.Parallel()
769769

770770
tests := []struct {
771-
name string
772-
embedding *mcpv1alpha1.EmbeddingServer
773-
existingSts *appsv1.StatefulSet
774-
expectCreate bool
775-
expectUpdate bool
776-
expectDone bool
771+
name string
772+
embedding *mcpv1alpha1.EmbeddingServer
773+
existingSts *appsv1.StatefulSet
774+
expectCreate bool
775+
expectUpdate bool
776+
expectDone bool
777777
}{
778778
{
779779
name: "create new statefulset",
@@ -855,7 +855,7 @@ func TestEnsureStatefulSet(t *testing.T) {
855855
assert.NoError(t, err)
856856

857857
if tt.expectUpdate {
858-
assert.True(t, result.Requeue)
858+
assert.Greater(t, result.RequeueAfter, time.Duration(0))
859859
}
860860
})
861861
}
@@ -950,4 +950,3 @@ func TestUpdateEmbeddingServerStatus(t *testing.T) {
950950
})
951951
}
952952
}
953-

0 commit comments

Comments
 (0)