Use arvados client for /any/path/$id/, not just /mnt/$id/.
authorTom Clegg <tom@tomclegg.ca>
Wed, 6 Oct 2021 20:07:40 +0000 (16:07 -0400)
committerTom Clegg <tom@tomclegg.ca>
Wed, 6 Oct 2021 20:07:40 +0000 (16:07 -0400)
refs #17996

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

arvados.go

index d4dcf7819e5709db98cdfd675a5e0d5aed828a0e..50ab375f816b52632c7d45913b3565a91fbaa185 100644 (file)
@@ -532,11 +532,8 @@ func open(fnm string) (file, error) {
        if m == nil {
                return os.Open(fnm)
        }
-       uuid := m[2]
-       mnt := "/mnt/" + uuid
-       if fnm != mnt && !strings.HasPrefix(fnm, mnt+"/") {
-               return os.Open(fnm)
-       }
+       collectionUUID := m[2]
+       collectionPath := fnm[strings.Index(fnm, collectionUUID)+len(collectionUUID):]
 
        siteFSMtx.Lock()
        defer siteFSMtx.Unlock()
@@ -556,8 +553,8 @@ func open(fnm string) (file, error) {
                keepClient.BlockCache.MaxBlocks += 2
        }
 
-       log.Infof("reading %q from %s using Arvados client", fnm[len(mnt):], uuid)
-       f, err := siteFS.Open("by_id/" + uuid + fnm[len(mnt):])
+       log.Infof("reading %q from %s using Arvados client", collectionPath, collectionUUID)
+       f, err := siteFS.Open("by_id/" + collectionUUID + collectionPath)
        if err != nil {
                return nil, err
        }