X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/42b483f3a722ad8a506040160e54d0080a197318..40500de7ecb33a0f2197b2fe2449e6fc14b835a4:/lib/controller/fed_collections.go diff --git a/lib/controller/fed_collections.go b/lib/controller/fed_collections.go index 07daf2f90e..a0a123129f 100644 --- a/lib/controller/fed_collections.go +++ b/lib/controller/fed_collections.go @@ -17,9 +17,9 @@ import ( "strings" "sync" - "git.curoverse.com/arvados.git/sdk/go/arvados" - "git.curoverse.com/arvados.git/sdk/go/httpserver" - "git.curoverse.com/arvados.git/sdk/go/keepclient" + "git.arvados.org/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/httpserver" + "git.arvados.org/arvados.git/sdk/go/keepclient" ) func rewriteSignatures(clusterID string, expectHash string, @@ -157,7 +157,7 @@ type searchRemoteClusterForPDH struct { func fetchRemoteCollectionByUUID( h *genericFederatedRequestHandler, effectiveMethod string, - clusterId *string, + clusterID *string, uuid string, remainder string, w http.ResponseWriter, @@ -170,11 +170,11 @@ func fetchRemoteCollectionByUUID( if uuid != "" { // Collection UUID GET request - *clusterId = uuid[0:5] - if *clusterId != "" && *clusterId != h.handler.Cluster.ClusterID { + *clusterID = uuid[0:5] + if *clusterID != "" && *clusterID != h.handler.Cluster.ClusterID { // request for remote collection by uuid - resp, err := h.handler.remoteClusterRequest(*clusterId, req) - newResponse, err := rewriteSignatures(*clusterId, "", resp, err) + resp, err := h.handler.remoteClusterRequest(*clusterID, req) + newResponse, err := rewriteSignatures(*clusterID, "", resp, err) h.handler.proxy.ForwardResponse(w, newResponse, err) return true } @@ -186,7 +186,7 @@ func fetchRemoteCollectionByUUID( func fetchRemoteCollectionByPDH( h *genericFederatedRequestHandler, effectiveMethod string, - clusterId *string, + clusterID *string, uuid string, remainder string, w http.ResponseWriter, @@ -232,6 +232,10 @@ func fetchRemoteCollectionByPDH( // No need to query local cluster again continue } + if remoteID == "*" { + // This isn't a real remote cluster: it just sets defaults for unlisted remotes. + continue + } wg.Add(1) go func(remote string) { @@ -293,10 +297,8 @@ func fetchRemoteCollectionByPDH( var errors []string for len(errorChan) > 0 { err := <-errorChan - if httperr, ok := err.(HTTPError); ok { - if httperr.Code != http.StatusNotFound { - errorCode = http.StatusBadGateway - } + if httperr, ok := err.(HTTPError); !ok || httperr.Code != http.StatusNotFound { + errorCode = http.StatusBadGateway } errors = append(errors, err.Error()) }