-
Notifications
You must be signed in to change notification settings - Fork 352
Open
Labels
kind/cleanupCleanup/refactor an existing component/codeCleanup/refactor an existing component/codetriage/acceptedThe issue was reviewed and is complete enough to start working on itThe issue was reviewed and is complete enough to start working on it
Description
Description
ServiceInsight is obsolete when using MeshServices. However, we still can't remove it as it's the only way GUI can get aggregated information in delegated gateway.
Also, GlobalInsight is using ServiceInsight:
kuma/pkg/insights/globalinsight/global_insight_service.go
Lines 119 to 146 in fc66bbf
| func (gis *defaultGlobalInsightService) aggregateServices( | |
| ctx context.Context, | |
| globalInsight *api_types.GlobalInsight, | |
| ) error { | |
| serviceInsights := &mesh.ServiceInsightResourceList{} | |
| if err := gis.resourceStore.List(ctx, serviceInsights); err != nil { | |
| return err | |
| } | |
| for _, serviceInsight := range serviceInsights.GetItems() { | |
| services := serviceInsight.GetSpec().(*mesh_proto.ServiceInsight).GetServices() | |
| for _, service := range services { | |
| switch service.GetServiceType() { | |
| case mesh_proto.ServiceInsight_Service_internal: | |
| updateServiceStatus(service.GetStatus(), &globalInsight.Services.Internal) | |
| case mesh_proto.ServiceInsight_Service_external: | |
| globalInsight.Services.External.Total += 1 | |
| case mesh_proto.ServiceInsight_Service_gateway_builtin: | |
| updateServiceStatus(service.GetStatus(), &globalInsight.Services.GatewayBuiltin) | |
| case mesh_proto.ServiceInsight_Service_gateway_delegated: | |
| updateServiceStatus(service.GetStatus(), &globalInsight.Services.GatewayDelegated) | |
| } | |
| } | |
| } | |
| return nil | |
| } |
Metadata
Metadata
Assignees
Labels
kind/cleanupCleanup/refactor an existing component/codeCleanup/refactor an existing component/codetriage/acceptedThe issue was reviewed and is complete enough to start working on itThe issue was reviewed and is complete enough to start working on it