Skip to content

Commit

Permalink
use args.Datacenter
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshasselberg committed Sep 21, 2020
1 parent 1c44e30 commit 43d2c08
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions agent/ui_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ RPC:
return nil, err
}

return summarizeServices(out.Dump, s.agent.config), nil
return summarizeServices(out.Dump, s.agent.config, args.Datacenter), nil
}

func summarizeServices(dump structs.ServiceDump, cfg *config.RuntimeConfig) []*ServiceSummary {
func summarizeServices(dump structs.ServiceDump, cfg *config.RuntimeConfig, datacenter string) []*ServiceSummary {
// Collect the summary information
var services []structs.ServiceID
summary := make(map[structs.ServiceID]*ServiceSummary)
Expand All @@ -226,7 +226,7 @@ func summarizeServices(dump structs.ServiceDump, cfg *config.RuntimeConfig) []*S
if csn.GatewayService != nil {
gwsvc := csn.GatewayService
sum := getService(gwsvc.Service.ToServiceID())
modifySummaryForGatewayService(cfg, sum, gwsvc)
modifySummaryForGatewayService(cfg, datacenter, sum, gwsvc)
}

// Will happen in cases where we only have the GatewayServices mapping
Expand Down Expand Up @@ -307,6 +307,7 @@ func summarizeServices(dump structs.ServiceDump, cfg *config.RuntimeConfig) []*S

func modifySummaryForGatewayService(
cfg *config.RuntimeConfig,
datacenter string,
sum *ServiceSummary,
gwsvc *structs.GatewayService,
) {
Expand All @@ -319,7 +320,7 @@ func modifySummaryForGatewayService(
}
dnsAddresses = append(dnsAddresses, serviceIngressDNSName(
gwsvc.Service.Name,
gwsvc.Service.Datacenter,
datacenter,
domain,
&gwsvc.Service.EnterpriseMeta,
))
Expand Down

0 comments on commit 43d2c08

Please sign in to comment.