-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'backend_tls' of https://github.com/alexwo/gateway
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
- Loading branch information
Showing
9 changed files
with
402 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// 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. | ||
|
||
//go:build e2e | ||
// +build e2e | ||
|
||
package mergegateways | ||
|
||
import ( | ||
"flag" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
"sigs.k8s.io/controller-runtime/pkg/client/config" | ||
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" | ||
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2" | ||
"sigs.k8s.io/gateway-api/conformance/utils/flags" | ||
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes" | ||
"sigs.k8s.io/gateway-api/conformance/utils/suite" | ||
|
||
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1" | ||
"github.com/envoyproxy/gateway/test/e2e" | ||
"github.com/envoyproxy/gateway/test/e2e/tests" | ||
) | ||
|
||
func TestMergeGateways(t *testing.T) { | ||
flag.Parse() | ||
|
||
cfg, err := config.GetConfig() | ||
require.NoError(t, err) | ||
|
||
c, err := client.New(cfg, client.Options{}) | ||
require.NoError(t, err) | ||
require.NoError(t, gwapiv1a2.AddToScheme(c.Scheme())) | ||
require.NoError(t, gwapiv1.AddToScheme(c.Scheme())) | ||
require.NoError(t, egv1a1.AddToScheme(c.Scheme())) | ||
|
||
if flags.RunTest != nil && *flags.RunTest != "" { | ||
t.Logf("Running E2E test %s with %s GatewayClass\n cleanup: %t\n debug: %t", | ||
*flags.RunTest, *flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug) | ||
} else { | ||
t.Logf("Running E2E tests with %s GatewayClass\n cleanup: %t\n debug: %t", | ||
*flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug) | ||
} | ||
|
||
cSuite := suite.New(suite.Options{ | ||
Client: c, | ||
GatewayClassName: *flags.GatewayClassName, | ||
Debug: *flags.ShowDebug, | ||
CleanupBaseResources: *flags.CleanupBaseResources, | ||
RunTest: *flags.RunTest, | ||
}) | ||
|
||
// Setting up the necessary arguments for the suite instead of calling Suite.Setup method again, | ||
// since this test suite reuse the base resources of previous test suite. | ||
cSuite.Applier.FS = e2e.Manifests | ||
cSuite.Applier.GatewayClass = *flags.GatewayClassName | ||
cSuite.ControllerName = kubernetes.GWCMustHaveAcceptedConditionTrue(t, | ||
cSuite.Client, cSuite.TimeoutConfig, cSuite.GatewayClassName) | ||
|
||
t.Logf("Running %d MergeGateways tests", len(tests.MergeGatewaysTests)) | ||
cSuite.Run(t, tests.MergeGatewaysTests) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: merged-gateway-1 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
gatewayClassName: merge-gateways | ||
listeners: | ||
- allowedRoutes: | ||
namespaces: | ||
from: Same | ||
name: http1 | ||
port: 8080 | ||
protocol: HTTP | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: merged-gateway-2 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
gatewayClassName: merge-gateways | ||
listeners: | ||
- allowedRoutes: | ||
namespaces: | ||
from: Same | ||
name: http2 | ||
port: 8081 | ||
protocol: HTTP | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: merged-gateway-3 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
gatewayClassName: merge-gateways | ||
listeners: | ||
- allowedRoutes: | ||
namespaces: | ||
from: Same | ||
name: http3 | ||
port: 8082 | ||
protocol: HTTP | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: merged-gateway-4 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
gatewayClassName: merge-gateways | ||
listeners: | ||
- allowedRoutes: | ||
namespaces: | ||
from: Same | ||
name: http3 | ||
port: 8082 | ||
protocol: HTTP | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: merged-gateway-route-1 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
parentRefs: | ||
- name: merged-gateway-1 | ||
hostnames: | ||
- "www.example1.com" | ||
rules: | ||
- backendRefs: | ||
- group: "" | ||
kind: Service | ||
name: infra-backend-v1 | ||
port: 8080 | ||
weight: 1 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /merge1 | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: merged-gateway-route-2 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
parentRefs: | ||
- name: merged-gateway-2 | ||
hostnames: | ||
- "www.example2.com" | ||
rules: | ||
- backendRefs: | ||
- group: "" | ||
kind: Service | ||
name: infra-backend-v2 | ||
port: 8080 | ||
weight: 1 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /merge2 | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: merged-gateway-route-3 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
parentRefs: | ||
- name: merged-gateway-3 | ||
hostnames: | ||
- "www.example3.com" | ||
rules: | ||
- backendRefs: | ||
- group: "" | ||
kind: Service | ||
name: infra-backend-v3 | ||
port: 8080 | ||
weight: 1 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /merge3 | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: merged-gateway-route-4 | ||
namespace: gateway-conformance-infra | ||
spec: | ||
parentRefs: | ||
- name: merged-gateway-4 | ||
hostnames: | ||
- "www.example4.com" | ||
rules: | ||
- backendRefs: | ||
- group: "" | ||
kind: Service | ||
name: infra-backend-v3 | ||
port: 8080 | ||
weight: 1 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /merge4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.