@@ -126,8 +126,9 @@ func TestBuildStatuses(t *testing.T) {
126126 },
127127 Gateway : & graph.Gateway {
128128 Source : gw ,
129- Listeners : map [string ]* graph.Listener {
130- "listener-80-1" : {
129+ Listeners : []* graph.Listener {
130+ {
131+ Name : "listener-80-1" ,
131132 Valid : true ,
132133 Routes : map [types.NamespacedName ]* graph.Route {
133134 {Namespace : "test" , Name : "hr-1" }: {},
@@ -152,8 +153,9 @@ func TestBuildStatuses(t *testing.T) {
152153 GatewayStatuses : status.GatewayStatuses {
153154 {Namespace : "test" , Name : "gateway" }: {
154155 Conditions : staticConds .NewDefaultGatewayConditions (),
155- ListenerStatuses : map [string ]status.ListenerStatus {
156- "listener-80-1" : {
156+ ListenerStatuses : []status.ListenerStatus {
157+ {
158+ Name : "listener-80-1" ,
157159 AttachedRoutes : 1 ,
158160 Conditions : staticConds .NewDefaultListenerConditions (),
159161 },
@@ -249,8 +251,9 @@ func TestBuildStatusesNginxErr(t *testing.T) {
249251 graph := & graph.Graph {
250252 Gateway : & graph.Gateway {
251253 Source : gw ,
252- Listeners : map [string ]* graph.Listener {
253- "listener-80-1" : {
254+ Listeners : []* graph.Listener {
255+ {
256+ Name : "listener-80-1" ,
254257 Valid : true ,
255258 Routes : map [types.NamespacedName ]* graph.Route {
256259 {Namespace : "test" , Name : "hr-1" }: {},
@@ -270,8 +273,9 @@ func TestBuildStatusesNginxErr(t *testing.T) {
270273 staticConds .NewGatewayAccepted (),
271274 staticConds .NewGatewayNotProgrammedInvalid (staticConds .GatewayMessageFailedNginxReload ),
272275 },
273- ListenerStatuses : map [string ]status.ListenerStatus {
274- "listener-80-1" : {
276+ ListenerStatuses : []status.ListenerStatus {
277+ {
278+ Name : "listener-80-1" ,
275279 AttachedRoutes : 1 ,
276280 Conditions : []conditions.Condition {
277281 staticConds .NewListenerAccepted (),
@@ -424,14 +428,16 @@ func TestBuildGatewayStatuses(t *testing.T) {
424428 name : "valid gateway; all valid listeners" ,
425429 gateway : & graph.Gateway {
426430 Source : gw ,
427- Listeners : map [string ]* graph.Listener {
428- "listener-valid-1" : {
431+ Listeners : []* graph.Listener {
432+ {
433+ Name : "listener-valid-1" ,
429434 Valid : true ,
430435 Routes : map [types.NamespacedName ]* graph.Route {
431436 {Namespace : "test" , Name : "hr-1" }: {},
432437 },
433438 },
434- "listener-valid-2" : {
439+ {
440+ Name : "listener-valid-2" ,
435441 Valid : true ,
436442 Routes : map [types.NamespacedName ]* graph.Route {
437443 {Namespace : "test" , Name : "hr-1" }: {},
@@ -443,12 +449,14 @@ func TestBuildGatewayStatuses(t *testing.T) {
443449 expected : status.GatewayStatuses {
444450 {Namespace : "test" , Name : "gateway" }: {
445451 Conditions : staticConds .NewDefaultGatewayConditions (),
446- ListenerStatuses : map [string ]status.ListenerStatus {
447- "listener-valid-1" : {
452+ ListenerStatuses : []status.ListenerStatus {
453+ {
454+ Name : "listener-valid-1" ,
448455 AttachedRoutes : 1 ,
449456 Conditions : staticConds .NewDefaultListenerConditions (),
450457 },
451- "listener-valid-2" : {
458+ {
459+ Name : "listener-valid-2" ,
452460 AttachedRoutes : 1 ,
453461 Conditions : staticConds .NewDefaultListenerConditions (),
454462 },
@@ -462,14 +470,16 @@ func TestBuildGatewayStatuses(t *testing.T) {
462470 name : "valid gateway; some valid listeners" ,
463471 gateway : & graph.Gateway {
464472 Source : gw ,
465- Listeners : map [string ]* graph.Listener {
466- "listener-valid" : {
473+ Listeners : []* graph.Listener {
474+ {
475+ Name : "listener-valid" ,
467476 Valid : true ,
468477 Routes : map [types.NamespacedName ]* graph.Route {
469478 {Namespace : "test" , Name : "hr-1" }: {},
470479 },
471480 },
472- "listener-invalid" : {
481+ {
482+ Name : "listener-invalid" ,
473483 Valid : false ,
474484 Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
475485 },
@@ -482,12 +492,14 @@ func TestBuildGatewayStatuses(t *testing.T) {
482492 staticConds .NewGatewayProgrammed (),
483493 staticConds .NewGatewayAcceptedListenersNotValid (),
484494 },
485- ListenerStatuses : map [string ]status.ListenerStatus {
486- "listener-valid" : {
495+ ListenerStatuses : []status.ListenerStatus {
496+ {
497+ Name : "listener-valid" ,
487498 AttachedRoutes : 1 ,
488499 Conditions : staticConds .NewDefaultListenerConditions (),
489500 },
490- "listener-invalid" : {
501+ {
502+ Name : "listener-invalid" ,
491503 Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
492504 },
493505 },
@@ -500,12 +512,14 @@ func TestBuildGatewayStatuses(t *testing.T) {
500512 name : "valid gateway; no valid listeners" ,
501513 gateway : & graph.Gateway {
502514 Source : gw ,
503- Listeners : map [string ]* graph.Listener {
504- "listener-invalid-1" : {
515+ Listeners : []* graph.Listener {
516+ {
517+ Name : "listener-invalid-1" ,
505518 Valid : false ,
506519 Conditions : staticConds .NewListenerUnsupportedProtocol ("unsupported protocol" ),
507520 },
508- "listener-invalid-2" : {
521+ {
522+ Name : "listener-invalid-2" ,
509523 Valid : false ,
510524 Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
511525 },
@@ -515,11 +529,13 @@ func TestBuildGatewayStatuses(t *testing.T) {
515529 expected : status.GatewayStatuses {
516530 {Namespace : "test" , Name : "gateway" }: {
517531 Conditions : staticConds .NewGatewayNotAcceptedListenersNotValid (),
518- ListenerStatuses : map [string ]status.ListenerStatus {
519- "listener-invalid-1" : {
532+ ListenerStatuses : []status.ListenerStatus {
533+ {
534+ Name : "listener-invalid-1" ,
520535 Conditions : staticConds .NewListenerUnsupportedProtocol ("unsupported protocol" ),
521536 },
522- "listener-invalid-2" : {
537+ {
538+ Name : "listener-invalid-2" ,
523539 Conditions : staticConds .NewListenerUnsupportedValue ("unsupported value" ),
524540 },
525541 },
@@ -548,8 +564,9 @@ func TestBuildGatewayStatuses(t *testing.T) {
548564 Source : gw ,
549565 Valid : true ,
550566 Conditions : staticConds .NewDefaultGatewayConditions (),
551- Listeners : map [string ]* graph.Listener {
552- "listener-valid" : {
567+ Listeners : []* graph.Listener {
568+ {
569+ Name : "listener-valid" ,
553570 Valid : true ,
554571 Routes : map [types.NamespacedName ]* graph.Route {
555572 {Namespace : "test" , Name : "hr-1" }: {},
@@ -563,8 +580,9 @@ func TestBuildGatewayStatuses(t *testing.T) {
563580 staticConds .NewGatewayAccepted (),
564581 staticConds .NewGatewayNotProgrammedInvalid (staticConds .GatewayMessageFailedNginxReload ),
565582 },
566- ListenerStatuses : map [string ]status.ListenerStatus {
567- "listener-valid" : {
583+ ListenerStatuses : []status.ListenerStatus {
584+ {
585+ Name : "listener-valid" ,
568586 AttachedRoutes : 1 ,
569587 Conditions : []conditions.Condition {
570588 staticConds .NewListenerAccepted (),
0 commit comments