Skip to content

Commit 0e3fe98

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

File tree

14 files changed

+20
-15
lines changed

14 files changed

+20
-15
lines changed

cmd/epp/main.go

+1
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

-2
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

+1
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

+3
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

-2
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

+1
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

+3-1
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

+2
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

+1
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

+1
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 {

test/e2e/epp/e2e_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ var _ = ginkgo.Describe("InferencePool", func() {
8787

8888
return nil
8989
}, readyTimeout, curlInterval).Should(gomega.Succeed())
90+
9091
})
9192
})
9293
})

test/integration/bbr/hermetic_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ func TestFullDuplexStreamed_BodyBasedRouting(t *testing.T) {
122122
RawValue: []byte("foo"),
123123
},
124124
},
125-
},
126-
},
125+
}},
127126
},
128127
},
129128
},
@@ -188,8 +187,7 @@ func TestFullDuplexStreamed_BodyBasedRouting(t *testing.T) {
188187
RawValue: []byte("sql-lora-sheddable"),
189188
},
190189
},
191-
},
192-
},
190+
}},
193191
},
194192
},
195193
},

test/integration/epp/hermetic_test.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ func TestFullDuplexStreamed_KubeInferenceModelRequest(t *testing.T) {
121121
KVCacheUsagePercent: 0.2,
122122
},
123123
},
124-
wantMetrics: map[string]string{
125-
`inference_model_request_total`: `
124+
wantMetrics: map[string]string{`inference_model_request_total`: `
126125
# HELP inference_model_request_total [ALPHA] Counter of inference model requests broken out for each model and target model.
127126
# TYPE inference_model_request_total counter
128127
inference_model_request_total{model_name="my-model",target_model_name="my-model-12345"} 1
@@ -154,8 +153,7 @@ func TestFullDuplexStreamed_KubeInferenceModelRequest(t *testing.T) {
154153
RawValue: []byte(strconv.Itoa(76)),
155154
},
156155
},
157-
},
158-
},
156+
}},
159157
},
160158
},
161159
},
@@ -239,8 +237,7 @@ func TestFullDuplexStreamed_KubeInferenceModelRequest(t *testing.T) {
239237
RawValue: []byte(strconv.Itoa(76)),
240238
},
241239
},
242-
},
243-
},
240+
}},
244241
},
245242
},
246243
},

test/utils/utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ func ExecCommandInPod(
240240
podNamespace, podName, containerName string,
241241
cmd []string,
242242
) (string, error) {
243+
243244
parameterCodec := runtime.NewParameterCodec(scheme)
244245

245246
req := kubeClient.CoreV1().RESTClient().

0 commit comments

Comments
 (0)