Skip to content

Commit

Permalink
fix grpc protocol
Browse files Browse the repository at this point in the history
Signed-off-by: Jintao Zhang <[email protected]>
  • Loading branch information
tao12345666333 committed Apr 9, 2024
1 parent 91d2c60 commit 3257481
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
- name: Verify generators consistency
env:
# The new version of GWAPI has not been released yet, and we have used a specific commit.
GATEWAY_API_VERSION: 1f401c5e2448b918e3e2d9da27302d598e488974
GATEWAY_API_VERSION: 1646f69cd9f53482da1157d9a843e32d3a921fbf
run: make verify.generators
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ require (
k8s.io/client-go v0.29.3
k8s.io/component-base v0.29.3
sigs.k8s.io/controller-runtime v0.17.2
sigs.k8s.io/gateway-api v1.0.1-0.20240328211832-1f401c5e2448
sigs.k8s.io/gateway-api v1.0.1-0.20240405150747-1646f69cd9f5
sigs.k8s.io/kustomize/api v0.16.0
sigs.k8s.io/kustomize/kyaml v0.16.0
sigs.k8s.io/yaml v1.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@ sigs.k8s.io/e2e-framework v0.3.1-0.20231113122213-262cac32d35e h1:lJqSZb2bAyfkPp
sigs.k8s.io/e2e-framework v0.3.1-0.20231113122213-262cac32d35e/go.mod h1:VIozg+of0zhkVGZcCWvKqH7vn7GTDDAa3h+w1OfH7Co=
sigs.k8s.io/gateway-api v1.0.1-0.20240328211832-1f401c5e2448 h1:AIl37wrNnGlVMn/q1GrUdZ7CVaCTEew75ZlgJt8lK/c=
sigs.k8s.io/gateway-api v1.0.1-0.20240328211832-1f401c5e2448/go.mod h1:KpckYqmi8L0CE8CJ2b6njSFtNZnhbRcHn3fdPRhKjxo=
sigs.k8s.io/gateway-api v1.0.1-0.20240405150747-1646f69cd9f5 h1:Ee8fc1GrFynZ0PkEd8gWyIPYHHtnBCIdDzJqyV/ESoA=
sigs.k8s.io/gateway-api v1.0.1-0.20240405150747-1646f69cd9f5/go.mod h1:o/RZAEw04U5bQyTX3bA0KA23EEf+NK9HNLHJK/f8I/w=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kind v0.22.0 h1:z/+yr/azoOfzsfooqRsPw1wjJlqT/ukXP0ShkHwNlsI=
Expand Down
4 changes: 2 additions & 2 deletions internal/dataplane/translator/translate_grpcroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (t *Translator) ingressRulesFromGRPCRoute(result *ingressRules, grpcroute *
// Create a service and attach the routes to it. Protocol for Service can be set via K8s object annotation
// "konghq.com/protocol", by default use "grpcs" to not break existing behavior when annotation is not specified.
service, err := generateKongServiceFromBackendRefWithRuleNumber(
t.logger, t.storer, result, grpcroute, ruleNumber, "grpcs", grpcBackendRefsToBackendRefs(rule.BackendRefs)...,
t.logger, t.storer, result, grpcroute, ruleNumber, "grpc", grpcBackendRefsToBackendRefs(rule.BackendRefs)...,
)
if err != nil {
return err
Expand Down Expand Up @@ -124,7 +124,7 @@ func (t *Translator) ingressRulesFromGRPCRouteWithPriority(
rules,
serviceName,
grpcRoute,
"grpcs",
"grpc",
grpcBackendRefsToBackendRefs(grpcRouteRule.BackendRefs)...,
)
kongService.Routes = append(
Expand Down
6 changes: 3 additions & 3 deletions test/conformance/gateway_conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var traditionalRoutesSupportedFeatures = []suite.SupportedFeature{
suite.SupportHTTPRouteResponseHeaderModification,
suite.SupportHTTPRouteBackendTimeout,
// experimental features
// suite.SupportGRPCRoute,
suite.SupportGRPCRoute,
}

var expressionRoutesSupportedFeatures = []suite.SupportedFeature{
Expand All @@ -44,7 +44,7 @@ var expressionRoutesSupportedFeatures = []suite.SupportedFeature{
suite.SupportHTTPRouteResponseHeaderModification,
suite.SupportHTTPRouteBackendTimeout,
// experimental features
// suite.SupportGRPCRoute,
suite.SupportGRPCRoute,
}

func TestGatewayConformance(t *testing.T) {
Expand Down Expand Up @@ -87,7 +87,7 @@ func TestGatewayConformance(t *testing.T) {
require.NoError(t, err)

t.Log("starting the gateway conformance test suite")
cSuite.Setup(t)
cSuite.Setup(t, tests.ConformanceTests)

go patchGatewayClassToPassTestGatewayClassObservedGenerationBump(ctx, t, k8sClient)

Expand Down
10 changes: 5 additions & 5 deletions test/consts/zz_generated_gateway.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3257481

Please sign in to comment.