X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8f76037ba8a37c488612285ffe70d26d0d038124..e36e81150649a6457c9cbf0101130cfdb776336f:/sdk/go/health/aggregator.go diff --git a/sdk/go/health/aggregator.go b/sdk/go/health/aggregator.go index 3f3a918004..564331327a 100644 --- a/sdk/go/health/aggregator.go +++ b/sdk/go/health/aggregator.go @@ -113,8 +113,8 @@ func (agg *Aggregator) ClusterHealth(cluster *arvados.Cluster) ClusterHealthResp mtx := sync.Mutex{} wg := sync.WaitGroup{} - for node, nodeConfig := range cluster.SystemNodes { - for svc, addr := range nodeConfig.ServicePorts() { + for profileName, profile := range cluster.NodeProfiles { + for svc, addr := range profile.ServicePorts() { // Ensure svc is listed in resp.Services. mtx.Lock() if _, ok := resp.Services[svc]; !ok { @@ -128,10 +128,10 @@ func (agg *Aggregator) ClusterHealth(cluster *arvados.Cluster) ClusterHealthResp } wg.Add(1) - go func(node string, svc arvados.ServiceName, addr string) { + go func(profileName string, svc arvados.ServiceName, addr string) { defer wg.Done() var result CheckResult - url, err := agg.pingURL(node, addr) + url, err := agg.pingURL(profileName, addr) if err != nil { result = CheckResult{ Health: "ERROR", @@ -152,7 +152,7 @@ func (agg *Aggregator) ClusterHealth(cluster *arvados.Cluster) ClusterHealthResp } else { resp.Health = "ERROR" } - }(node, svc, addr) + }(profileName, svc, addr) } } wg.Wait() @@ -217,7 +217,7 @@ func (agg *Aggregator) ping(url string, cluster *arvados.Cluster) (result CheckR } func (agg *Aggregator) checkAuth(req *http.Request, cluster *arvados.Cluster) bool { - creds := auth.NewCredentialsFromHTTPRequest(req) + creds := auth.CredentialsFromRequest(req) for _, token := range creds.Tokens { if token != "" && token == cluster.ManagementToken { return true