Skip to content

Commit aaa14e7

Browse files
nirrozenbaumkfswain
authored andcommitted
cleanup of unused fields and functions (kubernetes-sigs#1233)
Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent 252492d commit aaa14e7

File tree

14 files changed

+9
-78
lines changed

14 files changed

+9
-78
lines changed

pkg/epp/controller/inferencemodel_reconciler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222

2323
"k8s.io/apimachinery/pkg/api/errors"
2424
"k8s.io/apimachinery/pkg/types"
25-
"k8s.io/client-go/tools/record"
2625
ctrl "sigs.k8s.io/controller-runtime"
2726
"sigs.k8s.io/controller-runtime/pkg/client"
2827
"sigs.k8s.io/controller-runtime/pkg/event"
@@ -36,7 +35,6 @@ import (
3635

3736
type InferenceModelReconciler struct {
3837
client.Reader
39-
Record record.EventRecorder
4038
Datastore datastore.Datastore
4139
PoolNamespacedName types.NamespacedName
4240
}

pkg/epp/controller/inferencemodel_reconciler_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"k8s.io/apimachinery/pkg/runtime"
2727
"k8s.io/apimachinery/pkg/types"
2828
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
29-
"k8s.io/client-go/tools/record"
3029
ctrl "sigs.k8s.io/controller-runtime"
3130
"sigs.k8s.io/controller-runtime/pkg/client"
3231
"sigs.k8s.io/controller-runtime/pkg/client/fake"
@@ -205,7 +204,6 @@ func TestInferenceModelReconciler(t *testing.T) {
205204
_ = ds.PoolSet(context.Background(), fakeClient, pool)
206205
reconciler := &InferenceModelReconciler{
207206
Reader: fakeClient,
208-
Record: record.NewFakeRecorder(10),
209207
Datastore: ds,
210208
PoolNamespacedName: types.NamespacedName{Name: pool.Name, Namespace: pool.Namespace},
211209
}

pkg/epp/controller/inferencepool_reconciler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"context"
2121

2222
"k8s.io/apimachinery/pkg/api/errors"
23-
"k8s.io/client-go/tools/record"
2423
ctrl "sigs.k8s.io/controller-runtime"
2524
"sigs.k8s.io/controller-runtime/pkg/client"
2625
"sigs.k8s.io/controller-runtime/pkg/log"
@@ -35,7 +34,6 @@ import (
3534
// will have the proper controller that will create/manage objects on behalf of the server pool.
3635
type InferencePoolReconciler struct {
3736
client.Reader
38-
Record record.EventRecorder
3937
Datastore datastore.Datastore
4038
}
4139

pkg/epp/controller/inferencepool_reconciler_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ func diffStore(datastore datastore.Datastore, params diffStoreParams) string {
183183
if params.wantModels == nil {
184184
params.wantModels = []*v1alpha2.InferenceModel{}
185185
}
186-
gotModels := datastore.ModelGetAll()
187-
if diff := utiltest.DiffModelLists(params.wantModels, gotModels); diff != "" {
186+
187+
if diff := cmp.Diff(params.wantModels, datastore.ModelGetAll(), cmpopts.SortSlices(func(a, b *v1alpha2.InferenceModel) bool {
188+
return a.Name < b.Name
189+
})); diff != "" {
188190
return "models:" + diff
189191
}
190192
return ""

pkg/epp/controller/pod_reconciler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
corev1 "k8s.io/api/core/v1"
2424
apierrors "k8s.io/apimachinery/pkg/api/errors"
2525
"k8s.io/apimachinery/pkg/types"
26-
"k8s.io/client-go/tools/record"
2726
ctrl "sigs.k8s.io/controller-runtime"
2827
"sigs.k8s.io/controller-runtime/pkg/client"
2928
"sigs.k8s.io/controller-runtime/pkg/event"
@@ -38,7 +37,6 @@ import (
3837
type PodReconciler struct {
3938
client.Reader
4039
Datastore datastore.Datastore
41-
Record record.EventRecorder
4240
}
4341

4442
func (c *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {

pkg/epp/datastore/datastore_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,11 @@ func TestModel(t *testing.T) {
225225
t.Errorf("Unexpected operation result, want: %v, got: %v", test.wantOpResult, gotOpResult)
226226
}
227227

228-
if diff := testutil.DiffModelLists(test.wantModels, ds.ModelGetAll()); diff != "" {
228+
if diff := cmp.Diff(test.wantModels, ds.ModelGetAll(), cmpopts.SortSlices(func(a, b *v1alpha2.InferenceModel) bool {
229+
return a.Name < b.Name
230+
})); diff != "" {
229231
t.Errorf("Unexpected models diff: %s", diff)
230232
}
231-
232233
})
233234
}
234235
}

pkg/epp/requestcontrol/request_control_config.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,3 @@ func (c *Config) AddPlugins(pluginObjects ...plugins.Plugin) {
5858
}
5959
}
6060
}
61-
62-
func LoadRequestControlConfig(instantiatedPlugins map[string]plugins.Plugin) *Config {
63-
config := NewConfig()
64-
for _, plugin := range instantiatedPlugins {
65-
config.AddPlugins(plugin)
66-
}
67-
68-
return config
69-
}

pkg/epp/scheduling/framework/plugins/multi/prefix/plugin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
)
3535

3636
const (
37-
DefaultScorerWeight = 1
3837
// vLLM default token block size is 16, and a good guess of average characters per token is 4.
3938
DefaultHashBlockSize = 64
4039
// The maximum number of blocks to match. Two long requests with the same prefix up to this

pkg/epp/scheduling/framework/plugins/scorer/kvcache.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ import (
2626
)
2727

2828
const (
29-
DefaultKVCacheScorerWeight = 1
30-
KvCacheScorerType = "kv-cache-scorer"
29+
KvCacheScorerType = "kv-cache-scorer"
3130
)
3231

3332
// compile-time type assertion

pkg/epp/scheduling/framework/plugins/scorer/queue.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ import (
2727
)
2828

2929
const (
30-
DefaultQueueScorerWeight = 1
31-
QueueScorerType = "queue-scorer"
30+
QueueScorerType = "queue-scorer"
3231
)
3332

3433
// compile-time type assertion

0 commit comments

Comments
 (0)