Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit f5bb1ae

Browse files
committed
undo gofumpt
Signed-off-by: Maroon Ayoub <[email protected]>
1 parent 634c1fe commit f5bb1ae

File tree

14 files changed

+32
-39
lines changed

14 files changed

+32
-39
lines changed

cmd/epp/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@ func verifyMetricMapping(mapping backendmetrics.MetricMapping, logger logr.Logge
314314
if mapping.LoraRequestInfo == nil {
315315
logger.Info("Not scraping metric: LoraRequestInfo")
316316
}
317+
317318
}

pkg/epp/backend/metrics/fake.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ func (fpm *FakePodMetrics) String() string {
4040
func (fpm *FakePodMetrics) GetPod() *Pod {
4141
return fpm.Pod
4242
}
43-
4443
func (fpm *FakePodMetrics) GetMetrics() *Metrics {
4544
return fpm.Metrics
4645
}
47-
4846
func (fpm *FakePodMetrics) UpdatePod(pod *corev1.Pod) {
4947
fpm.Pod = toInternalPod(pod)
5048
}

pkg/epp/backend/metrics/metrics.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func (p *PodMetricsClientImpl) FetchMetrics(
4747
existing *Metrics,
4848
port int32,
4949
) (*Metrics, error) {
50+
5051
// Currently the metrics endpoint is hard-coded, which works with vLLM.
5152
// TODO(https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/16): Consume this from InferencePool config.
5253
url := "http://" + pod.Address + ":" + strconv.Itoa(int(port)) + "/metrics"

pkg/epp/backend/metrics/metrics_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func makeMetricFamily(name string, metrics ...*dto.Metric) *dto.MetricFamily {
5858
// --- Tests ---
5959

6060
func TestGetMetric(t *testing.T) {
61+
6162
metricFamilies := map[string]*dto.MetricFamily{
6263
"metric1": makeMetricFamily("metric1",
6364
makeMetric(map[string]string{"label1": "value1"}, 1.0, 1000),
@@ -165,6 +166,7 @@ func TestGetMetric(t *testing.T) {
165166

166167
for _, tt := range tests {
167168
t.Run(tt.name, func(t *testing.T) {
169+
168170
gotMetric, err := p.getMetric(metricFamilies, tt.spec)
169171

170172
if tt.wantError {
@@ -238,6 +240,7 @@ func TestLabelsMatch(t *testing.T) {
238240
}
239241

240242
func TestGetLatestLoraMetric(t *testing.T) {
243+
241244
testCases := []struct {
242245
name string
243246
metricFamilies map[string]*dto.MetricFamily

pkg/epp/backend/metrics/pod_metrics_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,10 @@ type fakeDataStore struct{}
8888
func (f *fakeDataStore) PoolGet() (*v1alpha2.InferencePool, error) {
8989
return &v1alpha2.InferencePool{Spec: v1alpha2.InferencePoolSpec{TargetPortNumber: 8000}}, nil
9090
}
91-
9291
func (f *fakeDataStore) PodGetAll() []PodMetrics {
9392
// Not implemented.
9493
return nil
9594
}
96-
9795
func (f *fakeDataStore) PodList(func(PodMetrics) bool) []PodMetrics {
9896
// Not implemented.
9997
return nil

pkg/epp/controller/inferencemodel_reconciler_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ func TestInferenceModelReconciler(t *testing.T) {
227227
if diff := diffStore(ds, diffStoreParams{wantPool: pool, wantModels: test.wantModels}); diff != "" {
228228
t.Errorf("Unexpected diff (+got/-want): %s", diff)
229229
}
230+
230231
})
231232
}
232233
}

pkg/epp/datastore/datastore.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ const (
3838
ModelNameIndexKey = "spec.modelName"
3939
)
4040

41-
var errPoolNotSynced = errors.New("InferencePool is not initialized in data store")
41+
var (
42+
errPoolNotSynced = errors.New("InferencePool is not initialized in data store")
43+
)
4244

4345
// The datastore is a local cache of relevant data for the given InferencePool (currently all pulled from k8s-api)
4446
type Datastore interface {

pkg/epp/datastore/datastore_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func TestModel(t *testing.T) {
204204
existing := ds.ModelDelete(types.NamespacedName{Name: model1ts.Name, Namespace: model1ts.Namespace})
205205
got := ds.ModelGet(tsModel)
206206
return existing != nil && got == nil
207+
207208
},
208209
wantOpResult: true,
209210
wantModels: []*v1alpha2.InferenceModel{model2chat},
@@ -225,6 +226,7 @@ func TestModel(t *testing.T) {
225226
if diff := testutil.DiffModelLists(test.wantModels, ds.ModelGetAll()); diff != "" {
226227
t.Errorf("Unexpected models diff: %s", diff)
227228
}
229+
228230
})
229231
}
230232
}

pkg/epp/scheduling/plugins/filter/filter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ var LoRAAffinityFilter = &baseFilter{
214214
// - Filtered slice of pod metrics based on affinity and availability
215215
// - Error if any issues occur during filtering
216216
func loRASoftAffinityFilterFunc(ctx *types.SchedulingContext, pods []types.Pod) []types.Pod {
217+
217218
// Pre-allocate slices with estimated capacity
218219
filtered_affinity := make([]types.Pod, 0, len(pods))
219220
filtered_available := make([]types.Pod, 0, len(pods))

pkg/epp/scheduling/scheduler_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ func (tp *TestPlugin) Filter(ctx *types.SchedulingContext, pods []types.Pod) []t
536536
tp.ReceivedRequestHeaders[key] = value
537537
}
538538
return findPods(ctx, tp.FilterRes...)
539+
539540
}
540541

541542
func (tp *TestPlugin) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types.Pod]float64 {

0 commit comments

Comments
 (0)