@@ -9,15 +9,12 @@ import (
99 "github.com/onsi/gomega/types"
1010 stackitconfig "github.com/stackitcloud/cloud-provider-stackit/pkg/stackit/config"
1111
12- //nolint:staticcheck // Temporary workaround: v2api OpenAPI generator currently misses enum constants.
13- lbLegacy "github.com/stackitcloud/stackit-sdk-go/services/loadbalancer"
1412 loadbalancer "github.com/stackitcloud/stackit-sdk-go/services/loadbalancer/v2api"
1513 corev1 "k8s.io/api/core/v1"
1614 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1715 "k8s.io/utils/ptr"
1816)
1917
20- //nolint:staticcheck // Temporary workaround: v2api OpenAPI generator currently misses enum constants
2118var _ = Describe ("lbSpecFromService" , func () {
2219 const (
2320 externalAddress = "123.124.88.99"
@@ -227,15 +224,15 @@ var _ = Describe("lbSpecFromService", func() {
227224 "Listeners" : ConsistOf (
228225 MatchFields (IgnoreExtras , Fields {
229226 "DisplayName" : PointTo (Equal ("http" )),
230- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP_PROXY ) )),
227+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP_PROXY )),
231228 }),
232229 MatchFields (IgnoreExtras , Fields {
233230 "DisplayName" : PointTo (Equal ("http-alt" )),
234- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP_PROXY ) )),
231+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP_PROXY )),
235232 }),
236233 MatchFields (IgnoreExtras , Fields {
237234 "DisplayName" : PointTo (Equal ("dns" )),
238- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_UDP ) )),
235+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_UDP )),
239236 }),
240237 ),
241238 })))
@@ -262,15 +259,15 @@ var _ = Describe("lbSpecFromService", func() {
262259 "Listeners" : ConsistOf (
263260 MatchFields (IgnoreExtras , Fields {
264261 "DisplayName" : PointTo (Equal ("http" )),
265- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP_PROXY ) )),
262+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP_PROXY )),
266263 }),
267264 MatchFields (IgnoreExtras , Fields {
268265 "DisplayName" : PointTo (Equal ("http-alt" )),
269- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP_PROXY ) )),
266+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP_PROXY )),
270267 }),
271268 MatchFields (IgnoreExtras , Fields {
272269 "DisplayName" : PointTo (Equal ("https" )),
273- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP ) )),
270+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP )),
274271 }),
275272 ),
276273 })))
@@ -295,7 +292,7 @@ var _ = Describe("lbSpecFromService", func() {
295292 "Listeners" : ConsistOf (
296293 MatchFields (IgnoreExtras , Fields {
297294 "DisplayName" : PointTo (Equal ("http" )),
298- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP ) )),
295+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP )),
299296 }),
300297 ),
301298 })))
@@ -375,13 +372,13 @@ var _ = Describe("lbSpecFromService", func() {
375372 Expect (spec .Listeners ).To (ConsistOf (
376373 MatchFields (IgnoreExtras , Fields {
377374 "DisplayName" : PointTo (Equal ("http" )),
378- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP ) )),
375+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP )),
379376 "Port" : PointTo (BeNumerically ("==" , 80 )),
380377 "TargetPool" : PointTo (Equal ("http" )),
381378 }),
382379 MatchFields (IgnoreExtras , Fields {
383380 "DisplayName" : PointTo (Equal ("dns" )),
384- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_UDP ) )),
381+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_UDP )),
385382 "Port" : PointTo (BeNumerically ("==" , 53 )),
386383 "TargetPool" : PointTo (Equal ("dns" )),
387384 }),
@@ -649,7 +646,7 @@ var _ = Describe("lbSpecFromService", func() {
649646 }),
650647 MatchFields (IgnoreExtras , Fields {
651648 "DisplayName" : PointTo (Equal ("my-tcp-proxy-port" )),
652- "Protocol" : PointTo (Equal (string ( lbLegacy . LISTENERPROTOCOL_TCP_PROXY ) )),
649+ "Protocol" : PointTo (Equal (loadbalancer . LISTENERPROTOCOL_PROTOCOL_TCP_PROXY )),
653650 "Tcp" : PointTo (MatchFields (IgnoreExtras , Fields {
654651 "IdleTimeout" : PointTo (Equal ("900s" )),
655652 })),
@@ -1160,7 +1157,7 @@ var _ = Describe("lbSpecFromService", func() {
11601157 Expect (err ).NotTo (HaveOccurred ())
11611158 Expect (spec .Networks ).To (ConsistOf (MatchFields (IgnoreExtras , Fields {
11621159 "NetworkId" : PointTo (Equal ("my-network" )),
1163- "Role" : PointTo (Equal (string ( lbLegacy . NETWORKROLE_LISTENERS_AND_TARGETS ) )),
1160+ "Role" : PointTo (Equal (loadbalancer . NETWORKROLE_ROLE_LISTENERS_AND_TARGETS )),
11641161 })))
11651162 })
11661163
@@ -1176,11 +1173,11 @@ var _ = Describe("lbSpecFromService", func() {
11761173 Expect (spec .Networks ).To (ConsistOf (
11771174 MatchFields (IgnoreExtras , Fields {
11781175 "NetworkId" : PointTo (Equal ("my-network" )),
1179- "Role" : PointTo (Equal (string ( lbLegacy . NETWORKROLE_TARGETS ) )),
1176+ "Role" : PointTo (Equal (loadbalancer . NETWORKROLE_ROLE_TARGETS )),
11801177 }),
11811178 MatchFields (IgnoreExtras , Fields {
11821179 "NetworkId" : PointTo (Equal ("my-listener-network" )),
1183- "Role" : PointTo (Equal (string ( lbLegacy . NETWORKROLE_LISTENERS ) )),
1180+ "Role" : PointTo (Equal (loadbalancer . NETWORKROLE_ROLE_LISTENERS )),
11841181 }),
11851182 ))
11861183 })
@@ -1224,7 +1221,6 @@ type compareLBwithSpecTest struct {
12241221 spec * loadbalancer.CreateLoadBalancerPayload
12251222}
12261223
1227- //nolint:staticcheck // Temporary workaround: v2api OpenAPI generator currently misses enum constants
12281224var _ = DescribeTable ("compareLBwithSpec" ,
12291225 func (t * compareLBwithSpecTest ) {
12301226 fulfills , immutableChanged := compareLBwithSpec (t .lb , t .spec )
@@ -1429,15 +1425,15 @@ var _ = DescribeTable("compareLBwithSpec",
14291425 PrivateNetworkOnly : new (true ),
14301426 },
14311427 Listeners : []loadbalancer.Listener {
1432- {Protocol : new (string (lbLegacy. LISTENERPROTOCOL_TCP ) )},
1428+ {Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_TCP )},
14331429 },
14341430 },
14351431 spec : & loadbalancer.CreateLoadBalancerPayload {
14361432 Options : & loadbalancer.LoadBalancerOptions {
14371433 PrivateNetworkOnly : new (true ),
14381434 },
14391435 Listeners : []loadbalancer.Listener {
1440- {Protocol : new (string (lbLegacy. LISTENERPROTOCOL_TCP_PROXY ) )},
1436+ {Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_TCP_PROXY )},
14411437 },
14421438 },
14431439 }),
@@ -1449,7 +1445,7 @@ var _ = DescribeTable("compareLBwithSpec",
14491445 },
14501446 Listeners : []loadbalancer.Listener {
14511447 {
1452- Protocol : new (string (lbLegacy. LISTENERPROTOCOL_TCP ) ),
1448+ Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_TCP ),
14531449 Tcp : & loadbalancer.OptionsTCP {
14541450 IdleTimeout : new ("60 s "),
14551451 },
@@ -1462,7 +1458,7 @@ var _ = DescribeTable("compareLBwithSpec",
14621458 },
14631459 Listeners : []loadbalancer.Listener {
14641460 {
1465- Protocol : new (string (lbLegacy. LISTENERPROTOCOL_TCP ) ),
1461+ Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_TCP ),
14661462 Tcp : & loadbalancer.OptionsTCP {
14671463 IdleTimeout : new ("120 s "),
14681464 },
@@ -1478,7 +1474,7 @@ var _ = DescribeTable("compareLBwithSpec",
14781474 },
14791475 Listeners : []loadbalancer.Listener {
14801476 {
1481- Protocol : new (string (lbLegacy. LISTENERPROTOCOL_UDP ) ),
1477+ Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_UDP ),
14821478 Udp : & loadbalancer.OptionsUDP {
14831479 IdleTimeout : new ("60 s "),
14841480 },
@@ -1491,7 +1487,7 @@ var _ = DescribeTable("compareLBwithSpec",
14911487 },
14921488 Listeners : []loadbalancer.Listener {
14931489 {
1494- Protocol : new (string (lbLegacy. LISTENERPROTOCOL_UDP ) ),
1490+ Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_UDP ),
14951491 Udp : & loadbalancer.OptionsUDP {
14961492 IdleTimeout : new ("120 s "),
14971493 },
@@ -1507,7 +1503,7 @@ var _ = DescribeTable("compareLBwithSpec",
15071503 },
15081504 Listeners : []loadbalancer.Listener {
15091505 {
1510- Protocol : new (string (lbLegacy. LISTENERPROTOCOL_TCP_PROXY ) ),
1506+ Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_TCP_PROXY ),
15111507 Tcp : & loadbalancer.OptionsTCP {
15121508 IdleTimeout : new ("60 s "),
15131509 },
@@ -1520,7 +1516,7 @@ var _ = DescribeTable("compareLBwithSpec",
15201516 },
15211517 Listeners : []loadbalancer.Listener {
15221518 {
1523- Protocol : new (string (lbLegacy. LISTENERPROTOCOL_TCP_PROXY ) ),
1519+ Protocol : new (loadbalancer. LISTENERPROTOCOL_PROTOCOL_TCP_PROXY ),
15241520 Tcp : & loadbalancer.OptionsTCP {
15251521 IdleTimeout : new ("120 s "),
15261522 },
@@ -1595,7 +1591,7 @@ var _ = DescribeTable("compareLBwithSpec",
15951591 },
15961592 Networks : []loadbalancer.Network {
15971593 {
1598- Role : new (string (lbLegacy. NETWORKROLE_LISTENERS ) ),
1594+ Role : new (loadbalancer. NETWORKROLE_ROLE_LISTENERS ),
15991595 },
16001596 },
16011597 },
@@ -1605,7 +1601,7 @@ var _ = DescribeTable("compareLBwithSpec",
16051601 },
16061602 Networks : []loadbalancer.Network {
16071603 {
1608- Role : new (string (lbLegacy. NETWORKROLE_TARGETS ) ),
1604+ Role : new (loadbalancer. NETWORKROLE_ROLE_TARGETS ),
16091605 },
16101606 },
16111607 },
0 commit comments