From cf46fbe776918ad19444e26d637ffcc79676ca23 Mon Sep 17 00:00:00 2001 From: Karol Szwaj Date: Mon, 19 Feb 2024 21:02:22 +0100 Subject: [PATCH] chore: remove invalid multiple GatewayClass e2e test (#2655) remove multiple GatewayClass e2e test Signed-off-by: Karol Szwaj --- test/e2e/testdata/multiple-gc.yaml | 191 ----------------------------- test/e2e/tests/multiple-gc.go | 69 ----------- 2 files changed, 260 deletions(-) delete mode 100644 test/e2e/testdata/multiple-gc.yaml delete mode 100644 test/e2e/tests/multiple-gc.go diff --git a/test/e2e/testdata/multiple-gc.yaml b/test/e2e/testdata/multiple-gc.yaml deleted file mode 100644 index 94682535573..00000000000 --- a/test/e2e/testdata/multiple-gc.yaml +++ /dev/null @@ -1,191 +0,0 @@ -kind: GatewayClass -apiVersion: gateway.networking.k8s.io/v1 -metadata: - name: internet -spec: - controllerName: gateway.envoyproxy.io/gatewayclass-controller - parametersRef: - name: internet-config - namespace: envoy-gateway-system - group: gateway.envoyproxy.io - kind: EnvoyProxy ---- -apiVersion: gateway.envoyproxy.io/v1alpha1 -kind: EnvoyProxy -metadata: - name: internet-config - namespace: envoy-gateway-system -spec: - mergeGateways: true ---- -kind: GatewayClass -apiVersion: gateway.networking.k8s.io/v1 -metadata: - name: private -spec: - controllerName: gateway.envoyproxy.io/gatewayclass-controller ---- -apiVersion: v1 -kind: Namespace -metadata: - name: internet - labels: - gateway-conformance: internet ---- -apiVersion: v1 -kind: Namespace -metadata: - name: private - labels: - gateway-conformance: private ---- -apiVersion: gateway.networking.k8s.io/v1 -kind: Gateway -metadata: - name: private-gateway - namespace: private -spec: - gatewayClassName: private - listeners: - - name: http - port: 80 - protocol: HTTP - allowedRoutes: - namespaces: - from: Same ---- -apiVersion: gateway.networking.k8s.io/v1 -kind: Gateway -metadata: - name: internet-gateway - namespace: internet -spec: - gatewayClassName: internet - listeners: - - name: http - port: 80 - protocol: HTTP - allowedRoutes: - namespaces: - from: Same ---- -apiVersion: v1 -kind: Service -metadata: - name: private-backend - namespace: private -spec: - selector: - app: private-backend - ports: - - protocol: TCP - port: 8080 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: private-backend - namespace: private - labels: - app: private-backend -spec: - replicas: 2 - selector: - matchLabels: - app: private-backend - template: - metadata: - labels: - app: private-backend - spec: - containers: - - name: private-backend - # From https://github.com/kubernetes-sigs/ingress-controller-conformance/tree/master/images/echoserver - image: gcr.io/k8s-staging-ingressconformance/echoserver:v20221109-7ee2f3e - 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: internet-backend - namespace: internet -spec: - selector: - app: internet-backend - ports: - - protocol: TCP - port: 8080 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: internet-backend - namespace: internet - labels: - app: internet-backend -spec: - replicas: 2 - selector: - matchLabels: - app: internet-backend - template: - metadata: - labels: - app: internet-backend - spec: - containers: - - name: internet-backend - image: gcr.io/k8s-staging-ingressconformance/echoserver:v20221109-7ee2f3e - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - resources: - requests: - cpu: 10m ---- -apiVersion: gateway.networking.k8s.io/v1 -kind: HTTPRoute -metadata: - name: internet-route - namespace: internet -spec: - parentRefs: - - name: internet-gateway - sectionName: http - rules: - - backendRefs: - - name: internet-backend - port: 8080 ---- -apiVersion: gateway.networking.k8s.io/v1 -kind: HTTPRoute -metadata: - name: private-route - namespace: private -spec: - parentRefs: - - name: private-gateway - sectionName: http - rules: - - backendRefs: - - name: private-backend - port: 8080 diff --git a/test/e2e/tests/multiple-gc.go b/test/e2e/tests/multiple-gc.go deleted file mode 100644 index 0977b6f1f47..00000000000 --- a/test/e2e/tests/multiple-gc.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright Envoy Gateway Authors -// SPDX-License-Identifier: Apache-2.0 -// The full text of the Apache license is available in the LICENSE file at -// the root of the repo. - -// This file contains code derived from upstream gateway-api, it will be moved to upstream. - -//go:build e2e -// +build e2e - -package tests - -import ( - "testing" - - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/conformance/utils/http" - "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" - "sigs.k8s.io/gateway-api/conformance/utils/suite" -) - -func init() { - ConformanceTests = append(ConformanceTests, MultipleGCTest) -} - -var MultipleGCTest = suite.ConformanceTest{ - ShortName: "MultipleGC", - Description: "Testing multiple GatewayClass with the same controller", - Manifests: []string{"testdata/multiple-gc.yaml"}, - Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { - t.Run("gc-1", func(t *testing.T) { - ns := "private" - routeNN := types.NamespacedName{Name: "private-route", Namespace: ns} - gwNN := types.NamespacedName{Name: "private-gateway", Namespace: ns} - gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN) - OkResp := http.ExpectedResponse{ - Request: http.Request{ - Path: "/", - }, - Response: http.Response{ - StatusCode: 200, - }, - Namespace: ns, - } - - // Send a request to an valid path and expect a successful response - http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, OkResp) - }) - t.Run("gc-2", func(t *testing.T) { - ns := "internet" - routeNN := types.NamespacedName{Name: "internet-route", Namespace: ns} - gwNN := types.NamespacedName{Name: "internet-gateway", Namespace: ns} - gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN) - OkResp := http.ExpectedResponse{ - Request: http.Request{ - Path: "/", - }, - Response: http.Response{ - StatusCode: 200, - }, - Namespace: ns, - } - - // Send a request to an valid path and expect a successful response - http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, OkResp) - }) - - }, -}