diff --git a/test/conformance/ingress/basic.go b/test/conformance/ingress/basic.go index 5a0fe110d..11c476c56 100644 --- a/test/conformance/ingress/basic.go +++ b/test/conformance/ingress/basic.go @@ -61,7 +61,10 @@ func TestBasicsHTTP2(t *testing.T) { t.Parallel() ctx, clients := context.Background(), test.Setup(t) - name, port, _ := CreateRuntimeService(ctx, t, clients, networking.ServicePortNameH2C) + name, port, _ := CreateRuntimeService(ctx, t, clients, + networking.ServicePortNameH2C, + networking.AppProtocolH2C, + ) // Create a simple Ingress over the Service. _, client, _ := CreateIngressReady(ctx, t, clients, v1alpha1.IngressSpec{ diff --git a/test/conformance/ingress/util.go b/test/conformance/ingress/util.go index d9142728f..3eb41dadc 100644 --- a/test/conformance/ingress/util.go +++ b/test/conformance/ingress/util.go @@ -92,7 +92,7 @@ func (ua *uaRoundTripper) RoundTrip(rq *http.Request) (*http.Response, error) { // specified with the given portName. It returns the service name, the port on // which the service is listening, and a "cancel" function to clean up the // created resources. -func CreateRuntimeService(ctx context.Context, t *testing.T, clients *test.Clients, portName string) (string, int, context.CancelFunc) { +func CreateRuntimeService(ctx context.Context, t *testing.T, clients *test.Clients, portName string, appProtocol ...string) (string, int, context.CancelFunc) { t.Helper() name := test.ObjectNameForTest(t) @@ -171,6 +171,10 @@ func CreateRuntimeService(ctx context.Context, t *testing.T, clients *test.Clien }, } + if len(appProtocol) > 0 { + svc.Spec.Ports[0].AppProtocol = ptr.String(appProtocol[0]) + } + return name, port, createPodAndService(ctx, t, clients, pod, svc) } @@ -558,7 +562,7 @@ func CreateGRPCService(ctx context.Context, t *testing.T, clients *test.Clients, Name: networking.ServicePortNameH2C, Port: int32(port), TargetPort: intstr.FromInt(containerPort), - AppProtocol: ptr.String("kubernetes.io/h2c"), + AppProtocol: ptr.String(networking.AppProtocolH2C), }}, Selector: map[string]string{ "test-pod": name,