Skip to content

Commit

Permalink
Remove redundant parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
vimystic committed Nov 20, 2024
1 parent 0a52ff4 commit 91bded5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion controllers/cosmosfullnode_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (r *CosmosFullNodeReconciler) Reconcile(ctx context.Context, req ctrl.Reque
}

// Reconcile pods.
podRequeue, err := r.podControl.Reconcile(ctx, reporter, crd, configCksums, syncInfo, crd.Spec.Ordinal.Start)
podRequeue, err := r.podControl.Reconcile(ctx, reporter, crd, configCksums, syncInfo)
if err != nil {
errs.Append(err)
}
Expand Down
1 change: 0 additions & 1 deletion internal/fullnode/pod_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func (pc PodControl) Reconcile(
crd *cosmosv1.CosmosFullNode,
cksums ConfigChecksums,
syncInfo map[string]*cosmosv1.SyncInfoPodStatus,
startingOrdinal int32,
) (bool, kube.ReconcileError) {
var pods corev1.PodList
if err := pc.client.List(ctx, &pods,
Expand Down
24 changes: 12 additions & 12 deletions internal/fullnode/pod_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestPodControl_Reconcile(t *testing.T) {
}

control := NewPodControl(mClient, nil)
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)
require.False(t, requeue)

Expand All @@ -108,7 +108,7 @@ func TestPodControl_Reconcile(t *testing.T) {
})

control := NewPodControl(mClient, nil)
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, nil, 0)
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, nil)
require.NoError(t, err)
require.True(t, requeue)

Expand Down Expand Up @@ -153,7 +153,7 @@ func TestPodControl_Reconcile(t *testing.T) {

// Trigger updates
crd.Spec.PodTemplate.Image = "new-image"
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)
require.True(t, requeue)

Expand All @@ -167,7 +167,7 @@ func TestPodControl_Reconcile(t *testing.T) {
return kube.ComputeRollout(maxUnavail, desired, ready)
}

requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

require.True(t, requeue)
Expand All @@ -191,7 +191,7 @@ func TestPodControl_Reconcile(t *testing.T) {
return kube.ComputeRollout(maxUnavail, desired, ready)
}

requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)
require.True(t, requeue)

Expand Down Expand Up @@ -267,7 +267,7 @@ func TestPodControl_Reconcile(t *testing.T) {

// Reconcile 1, should update 0 and 1

requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

// only handled 2 updates, so should requeue.
Expand All @@ -284,7 +284,7 @@ func TestPodControl_Reconcile(t *testing.T) {
return kube.ComputeRollout(maxUnavail, desired, ready)
}

requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

require.True(t, requeue)
Expand All @@ -310,7 +310,7 @@ func TestPodControl_Reconcile(t *testing.T) {
return kube.ComputeRollout(maxUnavail, desired, ready)
}

requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

// no further updates yet, should requeue.
Expand All @@ -334,7 +334,7 @@ func TestPodControl_Reconcile(t *testing.T) {
return kube.ComputeRollout(maxUnavail, desired, ready)
}

requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

// only handled 1 updates, so should requeue.
Expand All @@ -353,7 +353,7 @@ func TestPodControl_Reconcile(t *testing.T) {
return kube.ComputeRollout(maxUnavail, desired, ready)
}

requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

require.True(t, requeue)
Expand Down Expand Up @@ -381,7 +381,7 @@ func TestPodControl_Reconcile(t *testing.T) {
return kube.ComputeRollout(maxUnavail, desired, ready)
}

requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err = control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

// all updates are now handled, no longer need requeue.
Expand Down Expand Up @@ -458,7 +458,7 @@ func TestPodControl_Reconcile(t *testing.T) {
crd.Status.Height[pod.Name] = 100
}

requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo, 0)
requeue, err := control.Reconcile(ctx, nopReporter, &crd, nil, syncInfo)
require.NoError(t, err)

// all updates are handled, so should not requeue
Expand Down

0 comments on commit 91bded5

Please sign in to comment.