X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/273e436dbf8736869dde715e9bc04a20c169d63f..819e06bd1bbff1ad4ecf250d621a807033907c29:/lib/controller/federation/list.go diff --git a/lib/controller/federation/list.go b/lib/controller/federation/list.go index 6ee8133174..bc6d3e00a4 100644 --- a/lib/controller/federation/list.go +++ b/lib/controller/federation/list.go @@ -27,6 +27,7 @@ func (conn *Conn) generated_CollectionList(ctx context.Context, options arvados. var needSort atomic.Value needSort.Store(false) err := conn.splitListRequest(ctx, options, func(ctx context.Context, _ string, backend arvados.API, options arvados.ListOptions) ([]string, error) { + options.ForwardedFor = conn.cluster.ClusterID + "-" + options.ForwardedFor cl, err := backend.CollectionList(ctx, options) if err != nil { return nil, err @@ -106,6 +107,13 @@ func (conn *Conn) generated_CollectionList(ctx context.Context, options arvados. // corresponding options argument suitable for sending to that // backend. func (conn *Conn) splitListRequest(ctx context.Context, opts arvados.ListOptions, fn func(context.Context, string, arvados.API, arvados.ListOptions) ([]string, error)) error { + + if opts.BypassFederation || opts.ForwardedFor != "" { + // Client requested no federation. Pass through. + _, err := fn(ctx, conn.cluster.ClusterID, conn.local, opts) + return err + } + cannotSplit := false var matchAllFilters map[string]bool for _, f := range opts.Filters { @@ -242,7 +250,7 @@ func (conn *Conn) splitListRequest(ctx context.Context, opts arvados.ListOptions done, err := fn(ctx, clusterID, backend, remoteOpts) if err != nil { - errs <- httpErrorf(http.StatusBadGateway, err.Error()) + errs <- httpErrorf(http.StatusBadGateway, "%s", err.Error()) return } progress := false