Skip to content

Commit d1c561f

Browse files
committed
Work around for gke gateway implementation.
1 parent 92799fe commit d1c561f

File tree

5 files changed

+82
-3
lines changed

5 files changed

+82
-3
lines changed

conformance/conformance.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"io/fs"
2626
"os"
2727
"testing"
28+
"time"
2829

2930
"github.com/stretchr/testify/require"
3031
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@@ -153,6 +154,10 @@ func DefaultOptions(t *testing.T) confsuite.ConformanceOptions {
153154

154155
baseManifestsValue := "resources/manifests/manifests.yaml"
155156

157+
// DO NOT SUBMIT: delete before submitting
158+
timeConfig := confconfig.DefaultTimeoutConfig()
159+
timeConfig.HTTPRouteMustHaveCondition = 600 * time.Second
160+
timeConfig.MaxTimeToConsistency = 600 * time.Second
156161
opts := confsuite.ConformanceOptions{
157162
Client: c,
158163
ClientOptions: clientOptions,
@@ -163,7 +168,7 @@ func DefaultOptions(t *testing.T) confsuite.ConformanceOptions {
163168
Debug: *confflags.ShowDebug,
164169
CleanupBaseResources: *confflags.CleanupBaseResources,
165170
SupportedFeatures: sets.New[features.FeatureName](),
166-
TimeoutConfig: confconfig.DefaultTimeoutConfig(),
171+
TimeoutConfig: timeConfig,
167172
SkipTests: skipTests,
168173
ExemptFeatures: exemptFeatures,
169174
RunTest: *confflags.RunTest,

conformance/tests/basic/inferencepool_httproute_port_validation.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ var InferencePoolHTTPRoutePortValidation = suite.ConformanceTest{
130130
)
131131
gwapihttp.MakeRequestAndExpectEventuallyConsistentResponse(t, s.RoundTripper, s.TimeoutConfig, gatewayAddr, expectedResponse)
132132

133+
// t.Logf("Successfully verified HTTPRoute %s has conditions: Accepted=True and ResolvedRefs=False (Reason: %s) for Gateway %s due to port mismatch",
134+
// routeNN.String(), resolvedRefsCondition.Reason, gatewayNN.String())
133135
t.Logf("Successfully verified HTTPRoute %s has conditions: Accepted=True and ResolvedRefs=False (Reason: %s) for Gateway %s due to port mismatch",
134-
routeNN.String(), resolvedRefsCondition.Reason, gatewayNN.String())
136+
routeNN.String(), "resolvedRefsCondition", gatewayNN.String())
135137
})
136138
},
137139
}

conformance/tests/basic/inferencepool_httproute_port_validation.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,74 @@ spec:
6969
extensionRef:
7070
name: target-pool-port-validation-epp
7171
---
72+
apiVersion: v1
73+
kind: Service
74+
metadata:
75+
name: target-pool-port-validation-epp
76+
namespace: gateway-conformance-app-backend
77+
spec:
78+
selector:
79+
app: target-pool-port-validation-epp
80+
ports:
81+
- protocol: TCP
82+
port: 9002
83+
targetPort: 9002
84+
appProtocol: http2
85+
type: ClusterIP
86+
---
87+
apiVersion: apps/v1
88+
kind: Deployment
89+
metadata:
90+
name: target-pool-port-validation-epp
91+
namespace: gateway-conformance-app-backend
92+
labels:
93+
app: target-pool-port-validation-epp
94+
spec:
95+
replicas: 1
96+
selector:
97+
matchLabels:
98+
app: target-pool-port-validation-epp
99+
template:
100+
metadata:
101+
labels:
102+
app: target-pool-port-validation-epp
103+
spec:
104+
terminationGracePeriodSeconds: 130
105+
containers:
106+
- name: epp
107+
image: us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:main
108+
imagePullPolicy: Always
109+
args:
110+
- -poolName
111+
- "target-pool-port-validation"
112+
- "-poolNamespace"
113+
- "gateway-conformance-app-backend"
114+
- -v
115+
- "4"
116+
- --zap-encoder
117+
- "json"
118+
- -grpcPort
119+
- "9002"
120+
- -grpcHealthPort
121+
- "9003"
122+
ports:
123+
- containerPort: 9002
124+
- containerPort: 9003
125+
- name: metrics
126+
containerPort: 9090
127+
livenessProbe:
128+
grpc:
129+
port: 9003
130+
service: inference-extension
131+
initialDelaySeconds: 5
132+
periodSeconds: 10
133+
readinessProbe:
134+
grpc:
135+
port: 9003
136+
service: inference-extension
137+
initialDelaySeconds: 5
138+
periodSeconds: 10
139+
---
72140
# --- HTTPRoute Scenario 1: Port Unspecified ---
73141
apiVersion: gateway.networking.k8s.io/v1
74142
kind: HTTPRoute

conformance/utils/config/timing.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ type InferenceExtensionTimeoutConfig struct {
4545

4646
// DefaultInferenceExtensionTimeoutConfig returns a new InferenceExtensionTimeoutConfig with default values.
4747
func DefaultInferenceExtensionTimeoutConfig() InferenceExtensionTimeoutConfig {
48+
config := gatewayconfig.DefaultTimeoutConfig()
49+
config.HTTPRouteMustHaveCondition = 300 * time.Second
4850
return InferenceExtensionTimeoutConfig{
49-
TimeoutConfig: gatewayconfig.DefaultTimeoutConfig(), // Initialize embedded struct
51+
TimeoutConfig: config, // Initialize embedded struct
5052
InferencePoolMustHaveConditionTimeout: 300 * time.Second,
5153
InferencePoolMustHaveConditionInterval: 10 * time.Second,
5254
GatewayObjectPollInterval: 5 * time.Second,

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ sigs.k8s.io/controller-runtime v0.20.4 h1:X3c+Odnxz+iPTRobG4tp092+CvBU9UK0t/bRf+
321321
sigs.k8s.io/controller-runtime v0.20.4/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
322322
sigs.k8s.io/controller-tools v0.17.3 h1:lwFPLicpBKLgIepah+c8ikRBubFW5kOQyT88r3EwfNw=
323323
sigs.k8s.io/controller-tools v0.17.3/go.mod h1:1ii+oXcYZkxcBXzwv3YZBlzjt1fvkrCGjVF73blosJI=
324+
sigs.k8s.io/gateway-api v1.2.1 h1:fZZ/+RyRb+Y5tGkwxFKuYuSRQHu9dZtbjenblleOLHM=
325+
sigs.k8s.io/gateway-api v1.2.1/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0=
324326
sigs.k8s.io/gateway-api v1.3.0 h1:q6okN+/UKDATola4JY7zXzx40WO4VISk7i9DIfOvr9M=
325327
sigs.k8s.io/gateway-api v1.3.0/go.mod h1:d8NV8nJbaRbEKem+5IuxkL8gJGOZ+FJ+NvOIltV8gDk=
326328
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=

0 commit comments

Comments
 (0)