@@ -21,44 +21,13 @@ import (
2121 "fmt"
2222 "time"
2323
24- "github.com/apache/apisix-ingress-controller/test/e2e/framework"
2524 "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
2625 . "github.com/onsi/ginkgo/v2"
2726 . "github.com/onsi/gomega"
2827)
2928
3029var _ = Describe ("TCPRoute E2E Test" , func () {
3130 s := scaffold .NewDefaultScaffold ()
32-
33- var gatewayProxyYaml = `
34- apiVersion: apisix.apache.org/v1alpha1
35- kind: GatewayProxy
36- metadata:
37- name: %s
38- spec:
39- provider:
40- type: ControlPlane
41- controlPlane:
42- service:
43- name: %s
44- port: 9180
45- auth:
46- type: AdminKey
47- adminKey:
48- value: "%s"
49- `
50- getGatewayProxySpec := func () string {
51- return fmt .Sprintf (gatewayProxyYaml , s .Namespace (), framework .ProviderType , s .AdminKey ())
52- }
53-
54- var gatewayClassYaml = `
55- apiVersion: gateway.networking.k8s.io/v1
56- kind: GatewayClass
57- metadata:
58- name: %s
59- spec:
60- controllerName: %s
61- `
6231 Context ("TCPRoute Base" , func () {
6332 var tcpGateway = `
6433apiVersion: gateway.networking.k8s.io/v1
@@ -98,12 +67,12 @@ spec:
9867
9968 BeforeEach (func () {
10069 // Create GatewayProxy
101- Expect (s .CreateResourceFromStringWithNamespace (getGatewayProxySpec (), s .Namespace ())).
70+ Expect (s .CreateResourceFromStringWithNamespace (s . GetGatewayProxySpec (), s .Namespace ())).
10271 NotTo (HaveOccurred (), "creating GatewayProxy" )
10372
10473 // Create GatewayClass
10574 gatewayClassName := s .Namespace ()
106- Expect (s .CreateResourceFromStringWithNamespace (fmt .Sprintf (gatewayClassYaml , gatewayClassName , s .GetControllerName ()), "" )).
75+ Expect (s .CreateResourceFromStringWithNamespace (fmt .Sprintf (s . GetGatewayClassYaml () , gatewayClassName , s .GetControllerName ()), "" )).
10776 NotTo (HaveOccurred (), "creating GatewayClass" )
10877 gcyaml , _ := s .GetResourceYaml ("GatewayClass" , gatewayClassName )
10978 s .ResourceApplied ("GatewayClass" , gatewayClassName , gcyaml , 1 )
0 commit comments