@@ -25,53 +25,12 @@ import (
2525 . "github.com/onsi/gomega"
2626
2727 "github.com/apache/apisix-ingress-controller/internal/provider/adc"
28- "github.com/apache/apisix-ingress-controller/test/e2e/framework"
2928 "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
3029)
3130
3231var _ = Describe ("Test Consumer" , Label ("apisix.apache.org" , "v1alpha1" , "consumer" ), func () {
3332 s := scaffold .NewDefaultScaffold ()
3433
35- var gatewayProxyYaml = `
36- apiVersion: apisix.apache.org/v1alpha1
37- kind: GatewayProxy
38- metadata:
39- name: apisix-proxy-config
40- spec:
41- provider:
42- type: ControlPlane
43- controlPlane:
44- service:
45- name: %s
46- port: 9180
47- auth:
48- type: AdminKey
49- adminKey:
50- value: "%s"
51- `
52- var gatewayProxyYamlAPI7 = `
53- apiVersion: apisix.apache.org/v1alpha1
54- kind: GatewayProxy
55- metadata:
56- name: apisix-proxy-config
57- spec:
58- provider:
59- type: ControlPlane
60- controlPlane:
61- endpoints:
62- - %s
63- auth:
64- type: AdminKey
65- adminKey:
66- value: "%s"
67- `
68- getGatewayProxySpec := func () string {
69- if s .Deployer .Name () == adc .BackendModeAPI7EE {
70- return fmt .Sprintf (gatewayProxyYamlAPI7 , s .Deployer .GetAdminEndpoint (), s .AdminKey ())
71- }
72- return fmt .Sprintf (gatewayProxyYaml , framework .ProviderType , s .AdminKey ())
73- }
74-
7534 var defaultGatewayClass = `
7635apiVersion: gateway.networking.k8s.io/v1
7736kind: GatewayClass
@@ -178,7 +137,7 @@ spec:
178137`
179138
180139 BeforeEach (func () {
181- s .ApplyDefaultGatewayResource (getGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
140+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
182141 })
183142
184143 It ("limit-count plugin" , func () {
@@ -274,7 +233,7 @@ spec:
274233`
275234
276235 BeforeEach (func () {
277- s .ApplyDefaultGatewayResource (getGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
236+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
278237 })
279238
280239 It ("Create/Update/Delete" , func () {
@@ -423,7 +382,7 @@ spec:
423382`
424383
425384 BeforeEach (func () {
426- s .ApplyDefaultGatewayResource (getGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
385+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
427386 })
428387 It ("Create/Update/Delete" , func () {
429388 err := s .CreateResourceFromString (keyAuthSecret )
@@ -544,7 +503,7 @@ spec:
544503`
545504
546505 BeforeEach (func () {
547- s .ApplyDefaultGatewayResource (getGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
506+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
548507 })
549508
550509 It ("Should sync consumer when GatewayProxy is updated" , func () {
@@ -637,7 +596,7 @@ spec:
637596`
638597
639598 BeforeEach (func () {
640- s .ApplyDefaultGatewayResource (getGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
599+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec (), defaultGatewayClass , defaultGateway , defaultHTTPRoute )
641600 })
642601
643602 It ("Should sync Consumer during startup" , func () {
0 commit comments