@@ -43,13 +43,13 @@ var _ = Describe("Test ApisixConsumer", Label("apisix.apache.org", "v2", "apisix
4343
4444 BeforeEach (func () {
4545 By ("create GatewayProxy" )
46- gatewayProxy := fmt . Sprintf ( gatewayProxyYaml , s .Deployer .GetAdminEndpoint (), s .AdminKey ())
47- err := s .CreateResourceFromStringWithNamespace (gatewayProxy , "default" )
46+ gatewayProxy := getGatewayProxyYaml ( s . Namespace () , s .Deployer .GetAdminEndpoint (), s .AdminKey ())
47+ err := s .CreateResourceFromStringWithNamespace (gatewayProxy , s . Namespace () )
4848 Expect (err ).NotTo (HaveOccurred (), "creating GatewayProxy" )
4949 time .Sleep (5 * time .Second )
5050
5151 By ("create IngressClass" )
52- err = s .CreateResourceFromStringWithNamespace (ingressClassYaml , "" )
52+ err = s .CreateResourceFromStringWithNamespace (getIngressClassYaml ( s . Namespace (), s . Namespace ()) , "" )
5353 Expect (err ).NotTo (HaveOccurred (), "creating IngressClass" )
5454 time .Sleep (5 * time .Second )
5555 })
@@ -62,7 +62,7 @@ kind: ApisixConsumer
6262metadata:
6363 name: test-consumer
6464spec:
65- ingressClassName: apisix
65+ ingressClassName: %s
6666 authParameter:
6767 keyAuth:
6868 value:
@@ -74,7 +74,7 @@ kind: ApisixRoute
7474metadata:
7575 name: default
7676spec:
77- ingressClassName: apisix
77+ ingressClassName: %s
7878 http:
7979 - name: rule0
8080 match:
@@ -115,7 +115,7 @@ kind: ApisixConsumer
115115metadata:
116116 name: test-consumer
117117spec:
118- ingressClassName: apisix
118+ ingressClassName: %s
119119 authParameter:
120120 keyAuth:
121121 secretRef:
@@ -128,11 +128,12 @@ spec:
128128
129129 It ("Basic tests" , func () {
130130 By ("apply ApisixRoute" )
131- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, defaultApisixRoute )
131+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, fmt . Sprintf ( defaultApisixRoute , s . Namespace ()) )
132132
133133 By ("apply ApisixConsumer" )
134- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, keyAuth )
134+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, fmt . Sprintf ( keyAuth , s . Namespace ()) )
135135
136+ fmt .Println ("ASHISH GO CHECK" )
136137 By ("verify ApisixRoute with ApisixConsumer" )
137138 Eventually (request ).WithArguments ("/get" , Headers {
138139 "apikey" : "invalid-key" ,
@@ -157,15 +158,16 @@ spec:
157158
158159 It ("SecretRef tests" , func () {
159160 By ("apply ApisixRoute" )
160- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, defaultApisixRoute )
161+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, fmt . Sprintf ( defaultApisixRoute , s . Namespace ()) )
161162
162163 By ("apply Secret" )
163164 err := s .CreateResourceFromString (secret )
164165 Expect (err ).ShouldNot (HaveOccurred (), "creating Secret for ApisixConsumer" )
165166
166167 By ("apply ApisixConsumer" )
167- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, keyAuthWiwhSecret )
168+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, fmt . Sprintf ( keyAuthWiwhSecret , s . Namespace ()) )
168169
170+ fmt .Println ("ASHISH GO CHECK" )
169171 By ("verify ApisixRoute with ApisixConsumer" )
170172 Eventually (request ).WithArguments ("/get" , Headers {
171173 "apikey" : "invalid-key" ,
@@ -209,7 +211,7 @@ kind: ApisixConsumer
209211metadata:
210212 name: test-consumer
211213spec:
212- ingressClassName: apisix
214+ ingressClassName: %s
213215 authParameter:
214216 basicAuth:
215217 value:
@@ -222,7 +224,7 @@ kind: ApisixRoute
222224metadata:
223225 name: default
224226spec:
225- ingressClassName: apisix
227+ ingressClassName: %s
226228 http:
227229 - name: rule0
228230 match:
@@ -267,7 +269,7 @@ kind: ApisixConsumer
267269metadata:
268270 name: test-consumer
269271spec:
270- ingressClassName: apisix
272+ ingressClassName: %s
271273 authParameter:
272274 basicAuth:
273275 secretRef:
@@ -277,10 +279,10 @@ spec:
277279
278280 It ("Basic tests" , func () {
279281 By ("apply ApisixRoute" )
280- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, defaultApisixRoute )
282+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, fmt . Sprintf ( defaultApisixRoute , s . Namespace ()) )
281283
282284 By ("apply ApisixConsumer" )
283- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, basicAuth )
285+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, fmt . Sprintf ( basicAuth , s . Namespace ()) )
284286
285287 By ("verify ApisixRoute with ApisixConsumer" )
286288 s .RequestAssert (& scaffold.RequestAssert {
@@ -331,14 +333,14 @@ spec:
331333
332334 It ("SecretRef tests" , func () {
333335 By ("apply ApisixRoute" )
334- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, defaultApisixRoute )
336+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, & apiv2.ApisixRoute {}, fmt . Sprintf ( defaultApisixRoute , s . Namespace ()) )
335337
336338 By ("apply Secret" )
337339 err := s .CreateResourceFromString (secret )
338340 Expect (err ).ShouldNot (HaveOccurred (), "creating Secret for ApisixConsumer" )
339341
340342 By ("apply ApisixConsumer" )
341- applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, basicAuthWithSecret )
343+ applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "test-consumer" }, & apiv2.ApisixConsumer {}, fmt . Sprintf ( basicAuthWithSecret , s . Namespace ()) )
342344
343345 By ("verify ApisixRoute with ApisixConsumer" )
344346 s .RequestAssert (& scaffold.RequestAssert {
0 commit comments