@@ -126,8 +126,9 @@ func TestBuildStatuses(t *testing.T) {
126
126
},
127
127
Gateway : & graph.Gateway {
128
128
Source : gw ,
129
- Listeners : map [string ]* graph.Listener {
130
- "listener-80-1" : {
129
+ Listeners : []* graph.Listener {
130
+ {
131
+ Name : "listener-80-1" ,
131
132
Valid : true ,
132
133
Routes : map [types.NamespacedName ]* graph.Route {
133
134
{Namespace : "test" , Name : "hr-1" }: {},
@@ -152,8 +153,9 @@ func TestBuildStatuses(t *testing.T) {
152
153
GatewayStatuses : status.GatewayStatuses {
153
154
{Namespace : "test" , Name : "gateway" }: {
154
155
Conditions : staticConds .NewDefaultGatewayConditions (),
155
- ListenerStatuses : map [string ]status.ListenerStatus {
156
- "listener-80-1" : {
156
+ ListenerStatuses : []status.ListenerStatus {
157
+ {
158
+ Name : "listener-80-1" ,
157
159
AttachedRoutes : 1 ,
158
160
Conditions : staticConds .NewDefaultListenerConditions (),
159
161
},
@@ -249,8 +251,9 @@ func TestBuildStatusesNginxErr(t *testing.T) {
249
251
graph := & graph.Graph {
250
252
Gateway : & graph.Gateway {
251
253
Source : gw ,
252
- Listeners : map [string ]* graph.Listener {
253
- "listener-80-1" : {
254
+ Listeners : []* graph.Listener {
255
+ {
256
+ Name : "listener-80-1" ,
254
257
Valid : true ,
255
258
Routes : map [types.NamespacedName ]* graph.Route {
256
259
{Namespace : "test" , Name : "hr-1" }: {},
@@ -270,8 +273,9 @@ func TestBuildStatusesNginxErr(t *testing.T) {
270
273
staticConds .NewGatewayAccepted (),
271
274
staticConds .NewGatewayNotProgrammedInvalid (staticConds .GatewayMessageFailedNginxReload ),
272
275
},
273
- ListenerStatuses : map [string ]status.ListenerStatus {
274
- "listener-80-1" : {
276
+ ListenerStatuses : []status.ListenerStatus {
277
+ {
278
+ Name : "listener-80-1" ,
275
279
AttachedRoutes : 1 ,
276
280
Conditions : []conditions.Condition {
277
281
staticConds .NewListenerAccepted (),
@@ -424,14 +428,16 @@ func TestBuildGatewayStatuses(t *testing.T) {
424
428
name : "valid gateway; all valid listeners" ,
425
429
gateway : & graph.Gateway {
426
430
Source : gw ,
427
- Listeners : map [string ]* graph.Listener {
428
- "listener-valid-1" : {
431
+ Listeners : []* graph.Listener {
432
+ {
433
+ Name : "listener-valid-1" ,
429
434
Valid : true ,
430
435
Routes : map [types.NamespacedName ]* graph.Route {
431
436
{Namespace : "test" , Name : "hr-1" }: {},
432
437
},
433
438
},
434
- "listener-valid-2" : {
439
+ {
440
+ Name : "listener-valid-2" ,
435
441
Valid : true ,
436
442
Routes : map [types.NamespacedName ]* graph.Route {
437
443
{Namespace : "test" , Name : "hr-1" }: {},
@@ -443,12 +449,14 @@ func TestBuildGatewayStatuses(t *testing.T) {
443
449
expected : status.GatewayStatuses {
444
450
{Namespace : "test" , Name : "gateway" }: {
445
451
Conditions : staticConds .NewDefaultGatewayConditions (),
446
- ListenerStatuses : map [string ]status.ListenerStatus {
447
- "listener-valid-1" : {
452
+ ListenerStatuses : []status.ListenerStatus {
453
+ {
454
+ Name : "listener-valid-1" ,
448
455
AttachedRoutes : 1 ,
449
456
Conditions : staticConds .NewDefaultListenerConditions (),
450
457
},
451
- "listener-valid-2" : {
458
+ {
459
+ Name : "listener-valid-2" ,
452
460
AttachedRoutes : 1 ,
453
461
Conditions : staticConds .NewDefaultListenerConditions (),
454
462
},
@@ -462,14 +470,16 @@ func TestBuildGatewayStatuses(t *testing.T) {
462
470
name : "valid gateway; some valid listeners" ,
463
471
gateway : & graph.Gateway {
464
472
Source : gw ,
465
- Listeners : map [string ]* graph.Listener {
466
- "listener-valid" : {
473
+ Listeners : []* graph.Listener {
474
+ {
475
+ Name : "listener-valid" ,
467
476
Valid : true ,
468
477
Routes : map [types.NamespacedName ]* graph.Route {
469
478
{Namespace : "test" , Name : "hr-1" }: {},
470
479
},
471
480
},
472
- "listener-invalid" : {
481
+ {
482
+ Name : "listener-invalid" ,
473
483
Valid : false ,
474
484
Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
475
485
},
@@ -482,12 +492,14 @@ func TestBuildGatewayStatuses(t *testing.T) {
482
492
staticConds .NewGatewayProgrammed (),
483
493
staticConds .NewGatewayAcceptedListenersNotValid (),
484
494
},
485
- ListenerStatuses : map [string ]status.ListenerStatus {
486
- "listener-valid" : {
495
+ ListenerStatuses : []status.ListenerStatus {
496
+ {
497
+ Name : "listener-valid" ,
487
498
AttachedRoutes : 1 ,
488
499
Conditions : staticConds .NewDefaultListenerConditions (),
489
500
},
490
- "listener-invalid" : {
501
+ {
502
+ Name : "listener-invalid" ,
491
503
Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
492
504
},
493
505
},
@@ -500,12 +512,14 @@ func TestBuildGatewayStatuses(t *testing.T) {
500
512
name : "valid gateway; no valid listeners" ,
501
513
gateway : & graph.Gateway {
502
514
Source : gw ,
503
- Listeners : map [string ]* graph.Listener {
504
- "listener-invalid-1" : {
515
+ Listeners : []* graph.Listener {
516
+ {
517
+ Name : "listener-invalid-1" ,
505
518
Valid : false ,
506
519
Conditions : staticConds .NewListenerUnsupportedProtocol ("unsupported protocol" ),
507
520
},
508
- "listener-invalid-2" : {
521
+ {
522
+ Name : "listener-invalid-2" ,
509
523
Valid : false ,
510
524
Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
511
525
},
@@ -515,11 +529,13 @@ func TestBuildGatewayStatuses(t *testing.T) {
515
529
expected : status.GatewayStatuses {
516
530
{Namespace : "test" , Name : "gateway" }: {
517
531
Conditions : staticConds .NewGatewayNotAcceptedListenersNotValid (),
518
- ListenerStatuses : map [string ]status.ListenerStatus {
519
- "listener-invalid-1" : {
532
+ ListenerStatuses : []status.ListenerStatus {
533
+ {
534
+ Name : "listener-invalid-1" ,
520
535
Conditions : staticConds .NewListenerUnsupportedProtocol ("unsupported protocol" ),
521
536
},
522
- "listener-invalid-2" : {
537
+ {
538
+ Name : "listener-invalid-2" ,
523
539
Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
524
540
},
525
541
},
@@ -548,8 +564,9 @@ func TestBuildGatewayStatuses(t *testing.T) {
548
564
Source : gw ,
549
565
Valid : true ,
550
566
Conditions : staticConds .NewDefaultGatewayConditions (),
551
- Listeners : map [string ]* graph.Listener {
552
- "listener-valid" : {
567
+ Listeners : []* graph.Listener {
568
+ {
569
+ Name : "listener-valid" ,
553
570
Valid : true ,
554
571
Routes : map [types.NamespacedName ]* graph.Route {
555
572
{Namespace : "test" , Name : "hr-1" }: {},
@@ -563,8 +580,9 @@ func TestBuildGatewayStatuses(t *testing.T) {
563
580
staticConds .NewGatewayAccepted (),
564
581
staticConds .NewGatewayNotProgrammedInvalid (staticConds .GatewayMessageFailedNginxReload ),
565
582
},
566
- ListenerStatuses : map [string ]status.ListenerStatus {
567
- "listener-valid" : {
583
+ ListenerStatuses : []status.ListenerStatus {
584
+ {
585
+ Name : "listener-valid" ,
568
586
AttachedRoutes : 1 ,
569
587
Conditions : []conditions.Condition {
570
588
staticConds .NewListenerAccepted (),
0 commit comments