@@ -25,6 +25,7 @@ import (
2525 . "github.com/onsi/gomega"
2626
2727 "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
28+ "github.com/apache/apisix-ingress-controller/internal/types"
2829)
2930
3031var _ = Describe ("Test GatewayProxy" , Label ("apisix.apache.org" , "v1alpha1" , "gatewayproxy" ), func () {
@@ -135,7 +136,7 @@ spec:
135136 time .Sleep (5 * time .Second )
136137
137138 By ("Check GatewayClass condition" )
138- gcYaml , err := s .GetResourceYaml ("GatewayClass" , gatewayClassName )
139+ gcYaml , err := s .GetResourceYaml (types . KindGatewayClass , gatewayClassName )
139140 Expect (err ).NotTo (HaveOccurred (), "getting GatewayClass yaml" )
140141 Expect (gcYaml ).To (ContainSubstring (`status: "True"` ), "checking GatewayClass condition status" )
141142 Expect (gcYaml ).To (ContainSubstring ("message: the gatewayclass has been accepted by the apisix-ingress-controller" ), "checking GatewayClass condition message" )
@@ -151,7 +152,7 @@ spec:
151152 time .Sleep (5 * time .Second )
152153
153154 By ("check Gateway condition" )
154- gwyaml , err := s .GetResourceYaml ("Gateway" , s .Namespace ())
155+ gwyaml , err := s .GetResourceYaml (types . KindGateway , s .Namespace ())
155156 Expect (err ).NotTo (HaveOccurred (), "getting Gateway yaml" )
156157 Expect (gwyaml ).To (ContainSubstring (`status: "True"` ), "checking Gateway condition status" )
157158 Expect (gwyaml ).To (ContainSubstring ("message: the gateway has been accepted by the apisix-ingress-controller" ), "checking Gateway condition message" )
@@ -160,7 +161,7 @@ spec:
160161 Context ("Test Gateway with enabled GatewayProxy plugin" , func () {
161162 It ("Should apply plugin configuration when enabled" , func () {
162163 By ("Create HTTPRoute for Gateway with GatewayProxy" )
163- s .ResourceApplied ("HTTPRoute" , "test-route" , fmt .Sprintf (httpRouteForTest , s .Namespace ()), 1 )
164+ s .ResourceApplied (types . KindHTTPRoute , "test-route" , fmt .Sprintf (httpRouteForTest , s .Namespace ()), 1 )
164165
165166 By ("Check if the plugin is applied" )
166167 s .RequestAssert (& scaffold.RequestAssert {
@@ -178,7 +179,7 @@ spec:
178179 Expect (err ).NotTo (HaveOccurred (), "updating GatewayProxy with disabled plugin" )
179180
180181 By ("Create HTTPRoute for Gateway with GatewayProxy" )
181- s .ResourceApplied ("HTTPRoute" , "test-route" , fmt .Sprintf (httpRouteForTest , s .Namespace ()), 1 )
182+ s .ResourceApplied (types . KindHTTPRoute , "test-route" , fmt .Sprintf (httpRouteForTest , s .Namespace ()), 1 )
182183
183184 By ("Check if the plugin is not applied" )
184185 s .RequestAssert (& scaffold.RequestAssert {
@@ -215,7 +216,7 @@ spec:
215216 Expect (err ).NotTo (HaveOccurred (), "creating GatewayProxy with enabled plugin" )
216217
217218 By ("Create HTTPRoute" )
218- s .ResourceApplied ("HTTPRoute" , "test-route" , fmt .Sprintf (httpRouteForTest , s .Namespace ()), 1 )
219+ s .ResourceApplied (types . KindHTTPRoute , "test-route" , fmt .Sprintf (httpRouteForTest , s .Namespace ()), 1 )
219220
220221 s .RequestAssert (& scaffold.RequestAssert {
221222 Method : "GET" ,
@@ -286,7 +287,7 @@ spec:
286287 Expect (err ).NotTo (HaveOccurred (), "creating GatewayProxy with valid provider" )
287288
288289 s .RetryAssertion (func () string {
289- gpYaml , _ := s .GetResourceYaml ("GatewayProxy" , s .Namespace ())
290+ gpYaml , _ := s .GetResourceYaml (types . KindGatewayProxy , s .Namespace ())
290291 return gpYaml
291292 }).Should (ContainSubstring (`"type":"ControlPlane"` ), "checking GatewayProxy is applied" )
292293 })
0 commit comments