diff --git a/agent/consul/internal_endpoint_test.go b/agent/consul/internal_endpoint_test.go index 2ede0f7a3a..a88e3f98a6 100644 --- a/agent/consul/internal_endpoint_test.go +++ b/agent/consul/internal_endpoint_test.go @@ -1279,20 +1279,22 @@ func TestInternal_GatewayServiceDump_Terminating(t *testing.T) { Passing: 1, Warning: 1, }, + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, Checks: structs.HealthChecks{ { - Node: "baz", - CheckID: types.CheckID("db2-passing"), - Name: "db2-passing", - Status: "passing", - ServiceID: "db2", - ServiceName: "db", + Node: "baz", + CheckID: types.CheckID("db2-passing"), + Name: "db2-passing", + Status: "passing", + ServiceID: "db2", + ServiceName: "db", + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, }, GatewayService: &structs.GatewayService{ - Gateway: structs.ServiceID{ID: "terminating-gateway"}, - Service: structs.ServiceID{ID: "db"}, + Gateway: structs.NewServiceID("terminating-gateway", nil), + Service: structs.NewServiceID("db", nil), GatewayKind: "terminating-gateway", }, }, @@ -1309,28 +1311,30 @@ func TestInternal_GatewayServiceDump_Terminating(t *testing.T) { Passing: 1, Warning: 1, }, + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, Checks: structs.HealthChecks{ { - Node: "bar", - CheckID: types.CheckID("db-warning"), - Name: "db-warning", - Status: "warning", - ServiceID: "db", - ServiceName: "db", + Node: "bar", + CheckID: types.CheckID("db-warning"), + Name: "db-warning", + Status: "warning", + ServiceID: "db", + ServiceName: "db", + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, }, GatewayService: &structs.GatewayService{ - Gateway: structs.ServiceID{ID: "terminating-gateway"}, - Service: structs.ServiceID{ID: "db"}, + Gateway: structs.NewServiceID("terminating-gateway", nil), + Service: structs.NewServiceID("db", nil), GatewayKind: "terminating-gateway", }, }, { // Only GatewayService should be returned when linked service isn't registered GatewayService: &structs.GatewayService{ - Gateway: structs.ServiceID{ID: "terminating-gateway"}, - Service: structs.ServiceID{ID: "redis"}, + Gateway: structs.NewServiceID("terminating-gateway", nil), + Service: structs.NewServiceID("redis", nil), GatewayKind: "terminating-gateway", CAFile: "/etc/certs/ca.pem", CertFile: "/etc/certs/cert.pem", @@ -1608,20 +1612,22 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) { Passing: 1, Warning: 1, }, + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, Checks: structs.HealthChecks{ { - Node: "bar", - CheckID: types.CheckID("db-warning"), - Name: "db-warning", - Status: "warning", - ServiceID: "db", - ServiceName: "db", + Node: "bar", + CheckID: types.CheckID("db-warning"), + Name: "db-warning", + Status: "warning", + ServiceID: "db", + ServiceName: "db", + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, }, GatewayService: &structs.GatewayService{ - Gateway: structs.ServiceID{ID: "ingress-gateway"}, - Service: structs.ServiceID{ID: "db"}, + Gateway: structs.NewServiceID("ingress-gateway", nil), + Service: structs.NewServiceID("db", nil), GatewayKind: "ingress-gateway", Port: 8888, Protocol: "tcp", @@ -1640,20 +1646,22 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) { Passing: 1, Warning: 1, }, + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, Checks: structs.HealthChecks{ { - Node: "baz", - CheckID: types.CheckID("db2-passing"), - Name: "db2-passing", - Status: "passing", - ServiceID: "db2", - ServiceName: "db", + Node: "baz", + CheckID: types.CheckID("db2-passing"), + Name: "db2-passing", + Status: "passing", + ServiceID: "db2", + ServiceName: "db", + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, }, GatewayService: &structs.GatewayService{ - Gateway: structs.ServiceID{ID: "ingress-gateway"}, - Service: structs.ServiceID{ID: "db"}, + Gateway: structs.NewServiceID("ingress-gateway", nil), + Service: structs.NewServiceID("db", nil), GatewayKind: "ingress-gateway", Port: 8888, Protocol: "tcp", @@ -1662,8 +1670,8 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) { { // Only GatewayService should be returned when upstream isn't registered GatewayService: &structs.GatewayService{ - Gateway: structs.ServiceID{ID: "ingress-gateway"}, - Service: structs.ServiceID{ID: "web"}, + Gateway: structs.NewServiceID("ingress-gateway", nil), + Service: structs.NewServiceID("web", nil), GatewayKind: "ingress-gateway", Port: 8080, Protocol: "tcp", diff --git a/agent/ui_endpoint_test.go b/agent/ui_endpoint_test.go index 960bc8d653..153e86fd21 100644 --- a/agent/ui_endpoint_test.go +++ b/agent/ui_endpoint_test.go @@ -515,7 +515,8 @@ func TestUIGatewayServiceNodes_Terminating(t *testing.T) { dump := obj.([]*ServiceSummary) expect := []*ServiceSummary{ { - Name: "redis", + Name: "redis", + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, { Name: "db", @@ -525,6 +526,7 @@ func TestUIGatewayServiceNodes_Terminating(t *testing.T) { ChecksPassing: 1, ChecksWarning: 1, ChecksCritical: 0, + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, } assert.ElementsMatch(t, expect, dump) @@ -637,8 +639,9 @@ func TestUIGatewayServiceNodes_Ingress(t *testing.T) { dump := obj.([]*ServiceSummary) expect := []*ServiceSummary{ { - Name: "web", - GatewayConfig: GatewayConfig{ListenerPort: 8080}, + Name: "web", + GatewayConfig: GatewayConfig{ListenerPort: 8080}, + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, { Name: "db", @@ -649,6 +652,7 @@ func TestUIGatewayServiceNodes_Ingress(t *testing.T) { ChecksWarning: 1, ChecksCritical: 0, GatewayConfig: GatewayConfig{ListenerPort: 8888}, + EnterpriseMeta: *structs.DefaultEnterpriseMeta(), }, } assert.ElementsMatch(t, expect, dump)