@@ -68,35 +68,19 @@ spec:
6868`
6969
7070 BeforeEach (func () {
71- // Create GatewayProxy
72- Expect (s .CreateResourceFromString (s .GetGatewayProxySpec ())).
73- NotTo (HaveOccurred (), "creating GatewayProxy" )
71+ Expect (s .CreateResourceFromString (s .GetGatewayProxySpec ())).NotTo (HaveOccurred (), "creating GatewayProxy" )
7472
75- // Create GatewayClass
76- gatewayClassName := s .Namespace ()
77- Expect (s .CreateResourceFromString (s .GetGatewayClassYaml ())).
78- NotTo (HaveOccurred (), "creating GatewayClass" )
79- gcyaml , _ := s .GetResourceYaml ("GatewayClass" , gatewayClassName )
80- s .ResourceApplied ("GatewayClass" , gatewayClassName , gcyaml , 1 )
73+ Expect (s .CreateResourceFromString (s .GetGatewayClassYaml ())).NotTo (HaveOccurred (), "creating GatewayClass" )
8174
82- // Create Gateway with UDP listener
83- gatewayName := s .Namespace ()
84- Expect (s .CreateResourceFromString (fmt .Sprintf (udpGateway , gatewayName , gatewayClassName ))).
75+ Expect (s .CreateResourceFromString (fmt .Sprintf (udpGateway , s .Namespace (), s .Namespace ()))).
8576 NotTo (HaveOccurred (), "creating Gateway" )
86-
87- gwyaml , _ := s .GetResourceYaml ("Gateway" , gatewayName )
88- s .ResourceApplied ("Gateway" , gatewayName , gwyaml , 1 )
8977 })
9078
9179 It ("should route UDP traffic to backend service" , func () {
9280 dnsSvc := s .NewCoreDNSService ()
9381 gatewayName := s .Namespace ()
9482 By ("creating UDPRoute" )
95- Expect (s .CreateResourceFromString (fmt .Sprintf (udpRoute , gatewayName , dnsSvc .Name , dnsSvc .Spec .Ports [0 ].Port ))).
96- NotTo (HaveOccurred (), "creating UDPRoute" )
97-
98- // Verify UDPRoute status becomes programmed
99- routeYaml , _ := s .GetResourceYaml ("UDPRoute" , "udp-app-1" )
83+ routeYaml := fmt .Sprintf (udpRoute , gatewayName , dnsSvc .Name , dnsSvc .Spec .Ports [0 ].Port )
10084 s .ResourceApplied ("UDPRoute" , "udp-app-1" , routeYaml , 1 )
10185
10286 svc := s .GetDataplaneService ()
0 commit comments