Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ test:
go test -race -cover ./apis/... ./conformance/utils/...
# Run tests for each submodule.
cd "conformance/echo-basic" && go test -race -cover ./...
cd "conformance/grpc-echo" && go test -race -cover ./...
cd "gwctl" && go test -race -cover ./...

# Run conformance tests against controller implementation
Expand Down
141 changes: 141 additions & 0 deletions conformance/base/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,3 +507,144 @@ spec:
resources:
requests:
cpu: 10m
---
apiVersion: v1
kind: Service
metadata:
name: grpc-infra-backend-v1
namespace: gateway-conformance-infra
spec:
selector:
app: grpc-infra-backend-v1
ports:
- protocol: TCP
port: 8080
targetPort: 3000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grpc-infra-backend-v1
namespace: gateway-conformance-infra
labels:
app: grpc-infra-backend-v1
spec:
replicas: 2
selector:
matchLabels:
app: grpc-infra-backend-v1
template:
metadata:
labels:
app: grpc-infra-backend-v1
spec:
containers:
- name: grpc-infra-backend-v1
# TODO: Migate to gcr.io/k8s-staging-gateway-api once possible
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# TODO: Migate to gcr.io/k8s-staging-gateway-api once possible
# TODO: Migrate to gcr.io/k8s-staging-gateway-api once possible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also apparently we should have spaces instead of tabs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this TODO should be gone by the time this is merged. How can I know before I've submitted this PR what tag CI will result in with the image build? Or will I have to split this into two PRs: docker image additions and test implementations?

image: us-docker.pkg.dev/grpc-testing/testing-images-public/gateway-api/grpcechoserver:alpha3
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 10m
---
apiVersion: v1
kind: Service
metadata:
name: grpc-infra-backend-v2
namespace: gateway-conformance-infra
spec:
selector:
app: grpc-infra-backend-v2
ports:
- protocol: TCP
port: 8080
targetPort: 3000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grpc-infra-backend-v2
namespace: gateway-conformance-infra
labels:
app: grpc-infra-backend-v2
spec:
replicas: 2
selector:
matchLabels:
app: grpc-infra-backend-v2
template:
metadata:
labels:
app: grpc-infra-backend-v2
spec:
containers:
- name: grpc-infra-backend-v2
# TODO: Migate to gcr.io/k8s-staging-gateway-api once possible
image: us-docker.pkg.dev/grpc-testing/testing-images-public/gateway-api/grpcechoserver:alpha3
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 10m
---
apiVersion: v1
kind: Service
metadata:
name: grpc-infra-backend-v3
namespace: gateway-conformance-infra
spec:
selector:
app: grpc-infra-backend-v3
ports:
- protocol: TCP
port: 8080
targetPort: 3000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grpc-infra-backend-v3
namespace: gateway-conformance-infra
labels:
app: grpc-infra-backend-v3
spec:
replicas: 2
selector:
matchLabels:
app: grpc-infra-backend-v3
template:
metadata:
labels:
app: grpc-infra-backend-v3
spec:
containers:
- name: grpc-infra-backend-v3
# TODO: Migate to gcr.io/k8s-staging-gateway-api once possible
image: us-docker.pkg.dev/grpc-testing/testing-images-public/gateway-api/grpcechoserver:alpha3
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 10m
1 change: 1 addition & 0 deletions conformance/grpc-echo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grpc-echo
16 changes: 16 additions & 0 deletions conformance/grpc-echo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module sigs.k8s.io/gateway-api/conformance/grpc-echo

go 1.21

require (
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.28.1
)

require (
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
)
21 changes: 21 additions & 0 deletions conformance/grpc-echo/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
95 changes: 95 additions & 0 deletions conformance/grpc-echo/grpcecho.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Copyright 2024 The Kubernetes Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

option go_package = "sigs.k8s.io/gateway-api/conformance/grpc-echo/grpcechoserver";

package gateway_api_conformance.grpc_echo.grpcecho;

message Header {
string key = 1;
string value = 2;
}

message Context {
// The Kubernetes namespace in which this server is running. Populated by the
// NAMESPACE environment variable.
string namespace = 1;

// The name of the ingress controller under test. Populated by the INGRESS_NAME
// environment variable.
string ingress = 2;

// The name service cannot be used here since it is a reserved word. Populated by the
// SERVICE_NAME environment variable.
string service_name = 3;

// The name of the pod in which this server is running. Populated by the POD_NAME
// environment variable.
string pod = 4;
}

message TLSAssertions {
// The TLS version used by the connection, e.g. "TLSv1.3"
string version = 1;

// The negotatiated protocol.
string negotiated_protocol = 2;

// The server name indication extension sent by the client.
string server_name = 3;

// The cipher suite negotatiated for the connection, e.g. "TLS_EDCHE_ECDSA_WITH_AES_128_GCM_SHA256"
string cipher_suite = 4;

// The parsed certificates sent by the peer, in the order in which they were sent.
repeated string peer_certificates = 5;
}

message Assertions {
// The fully qualified method of the current RPC, e.g.
// "/gateway_api_conformance.grpc_echo.grpcecho.GrpcEcho/Echo"
string fully_qualified_method = 1;

// The headers present in the request.
repeated Header headers = 2;

// The :authority pseudo-header of the request.
string authority = 3;

// Information associated with the conformance server deployment.
Context context = 4;

// Information related to the TLS connection between the client and the server.
TLSAssertions tls_assertions = 5;
}

message EchoRequest {}

message EchoResponse {
Assertions assertions = 1;
EchoRequest request = 2;
}

service GrpcEcho {
rpc Echo(EchoRequest) returns (EchoResponse) {}

// Behaves identically to Echo, but lives at a different method to
// emulate the service having more than one method.
rpc EchoTwo(EchoRequest) returns (EchoResponse) {}

// An intentionally unimplemented method.
rpc EchoThree(EchoRequest) returns (EchoResponse) {}
}
Loading