Skip to content

Commit 45db9d4

Browse files
committed
fix v2 lint issues
Signed-off-by: Etai Lev Ran <elevran@gmail.com>
1 parent 93ddc7e commit 45db9d4

File tree

7 files changed

+20
-22
lines changed

7 files changed

+20
-22
lines changed

conformance/conformance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func ensureGatewayAvailableAndReady(t *testing.T, k8sClient client.Client, opts
296296
extTimeoutConf := inferenceconfig.DefaultInferenceExtensionTimeoutConfig()
297297

298298
// Use the GatewayMustHaveAddress timeout from the suite's base TimeoutConfig for the Gateway object to appear.
299-
waitForGatewayCreationTimeout := extTimeoutConf.TimeoutConfig.GatewayMustHaveAddress
299+
waitForGatewayCreationTimeout := extTimeoutConf.GatewayMustHaveAddress
300300

301301
logDebugf(t, opts.Debug, "Waiting up to %v for Gateway object %s/%s to appear after manifest application...", waitForGatewayCreationTimeout, gatewayNN.Namespace, gatewayNN.Name)
302302

conformance/tests/basic/gateway_following_epp_routing.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"sigs.k8s.io/gateway-api-inference-extension/conformance/tests"
3434
k8sutils "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/kubernetes"
3535
"sigs.k8s.io/gateway-api-inference-extension/conformance/utils/traffic"
36-
trafficutils "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/traffic"
3736
)
3837

3938
func init() {
@@ -94,12 +93,12 @@ var GatewayFollowingEPPRouting = suite.ConformanceTest{
9493
for i := 0; i < len(pods); i++ {
9594
// Send an initial request targeting a single pod and wait for it to be successful to ensure the Gateway and EPP
9695
// are functioning correctly before running the main test cases.
97-
trafficutils.MakeRequestAndExpectSuccess(
96+
traffic.MakeRequestAndExpectSuccess(
9897
t,
9998
s.RoundTripper,
10099
s.TimeoutConfig,
101100
gwAddr,
102-
trafficutils.Request{
101+
traffic.Request{
103102
Host: hostname,
104103
Path: path,
105104
Headers: map[string]string{eppSelectionHeaderName: podIPs[i]},

conformance/utils/kubernetes/helpers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func checkCondition(t *testing.T, conditions []metav1.Condition, expectedConditi
7272
func InferencePoolMustHaveCondition(t *testing.T, c client.Reader, poolNN types.NamespacedName, expectedCondition metav1.Condition) {
7373
t.Helper() // Marks this function as a test helper
7474

75-
var timeoutConfig config.InferenceExtensionTimeoutConfig = config.DefaultInferenceExtensionTimeoutConfig()
75+
var timeoutConfig = config.DefaultInferenceExtensionTimeoutConfig()
7676
var lastObservedPool *inferenceapi.InferencePool
7777
var lastError error
7878
var conditionFound bool
@@ -165,7 +165,7 @@ func InferencePoolMustHaveNoParents(t *testing.T, c client.Reader, poolNN types.
165165

166166
var lastObservedPool *inferenceapi.InferencePool
167167
var lastError error
168-
var timeoutConfig config.InferenceExtensionTimeoutConfig = config.DefaultInferenceExtensionTimeoutConfig()
168+
var timeoutConfig = config.DefaultInferenceExtensionTimeoutConfig()
169169

170170
ctx := context.Background()
171171
waitErr := wait.PollUntilContextTimeout(
@@ -286,7 +286,7 @@ func HTTPRouteAndInferencePoolMustBeAcceptedAndRouteAccepted(
286286
gatewayNN types.NamespacedName,
287287
poolNN types.NamespacedName) {
288288
t.Helper()
289-
var timeoutConfig config.InferenceExtensionTimeoutConfig = config.DefaultInferenceExtensionTimeoutConfig()
289+
var timeoutConfig = config.DefaultInferenceExtensionTimeoutConfig()
290290

291291
HTTPRouteMustBeAcceptedAndResolved(t, c, timeoutConfig.TimeoutConfig, routeNN, gatewayNN)
292292
InferencePoolMustBeRouteAccepted(t, c, poolNN)

pkg/bbr/handlers/request.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323

2424
basepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
2525
eppb "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3"
26-
extProcPb "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3"
2726
"sigs.k8s.io/controller-runtime/pkg/log"
2827

2928
"sigs.k8s.io/gateway-api-inference-extension/pkg/bbr/metrics"
@@ -122,13 +121,13 @@ func (s *Server) HandleRequestBody(ctx context.Context, requestBodyBytes []byte)
122121
}
123122

124123
func addStreamedBodyResponse(responses []*eppb.ProcessingResponse, requestBodyBytes []byte) []*eppb.ProcessingResponse {
125-
return append(responses, &extProcPb.ProcessingResponse{
126-
Response: &extProcPb.ProcessingResponse_RequestBody{
127-
RequestBody: &extProcPb.BodyResponse{
128-
Response: &extProcPb.CommonResponse{
129-
BodyMutation: &extProcPb.BodyMutation{
130-
Mutation: &extProcPb.BodyMutation_StreamedResponse{
131-
StreamedResponse: &extProcPb.StreamedBodyResponse{
124+
return append(responses, &eppb.ProcessingResponse{
125+
Response: &eppb.ProcessingResponse_RequestBody{
126+
RequestBody: &eppb.BodyResponse{
127+
Response: &eppb.CommonResponse{
128+
BodyMutation: &eppb.BodyMutation{
129+
Mutation: &eppb.BodyMutation_StreamedResponse{
130+
StreamedResponse: &eppb.StreamedBodyResponse{
132131
Body: requestBodyBytes,
133132
EndOfStream: true,
134133
},

pkg/epp/datastore/datastore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (ds *datastore) ModelSetIfOlder(infModel *v1alpha2.InferenceModel) bool {
175175
existing, exists := ds.models[infModel.Spec.ModelName]
176176
if exists {
177177
diffObj := infModel.Name != existing.Name || infModel.Namespace != existing.Namespace
178-
if diffObj && existing.ObjectMeta.CreationTimestamp.Before(&infModel.ObjectMeta.CreationTimestamp) {
178+
if diffObj && existing.CreationTimestamp.Before(&infModel.CreationTimestamp) {
179179
return false
180180
}
181181
}
@@ -205,7 +205,7 @@ func (ds *datastore) ModelResync(ctx context.Context, reader client.Reader, mode
205205
!m.DeletionTimestamp.IsZero() { // ignore objects marked for deletion
206206
continue
207207
}
208-
if oldest == nil || m.ObjectMeta.CreationTimestamp.Before(&oldest.ObjectMeta.CreationTimestamp) {
208+
if oldest == nil || m.CreationTimestamp.Before(&oldest.CreationTimestamp) {
209209
oldest = m
210210
}
211211
}

pkg/epp/util/testing/wrappers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (p *PodWrapper) IP(ip string) *PodWrapper {
101101
func (p *PodWrapper) DeletionTimestamp() *PodWrapper {
102102
now := metav1.Now()
103103
p.ObjectMeta.DeletionTimestamp = &now
104-
p.ObjectMeta.Finalizers = []string{"finalizer"}
104+
p.Finalizers = []string{"finalizer"}
105105
return p
106106
}
107107

@@ -160,7 +160,7 @@ func (m *InferenceModelWrapper) Criticality(criticality v1alpha2.Criticality) *I
160160
func (m *InferenceModelWrapper) DeletionTimestamp() *InferenceModelWrapper {
161161
now := metav1.Now()
162162
m.ObjectMeta.DeletionTimestamp = &now
163-
m.ObjectMeta.Finalizers = []string{"finalizer"}
163+
m.Finalizers = []string{"finalizer"}
164164
return m
165165
}
166166

pkg/generator/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ func main() {
7979
crdRaw := parser.CustomResourceDefinitions[groupKind]
8080

8181
// Inline version of "addAttribution(&crdRaw)" ...
82-
if crdRaw.ObjectMeta.Annotations == nil {
83-
crdRaw.ObjectMeta.Annotations = map[string]string{}
82+
if crdRaw.Annotations == nil {
83+
crdRaw.Annotations = map[string]string{}
8484
}
85-
crdRaw.ObjectMeta.Annotations[version.BundleVersionAnnotation] = version.BundleVersion
85+
crdRaw.Annotations[version.BundleVersionAnnotation] = version.BundleVersion
8686

8787
// Prevent the top level metadata for the CRD to be generated regardless of the intention in the arguments
8888
crd.FixTopLevelMetadata(crdRaw)

0 commit comments

Comments
 (0)