X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9e37d22cf961167df7ce5f7ac934059749363500..419db47f0e97123cb3ff491d189b5607468101da:/sdk/go/arvados/fs_site.go diff --git a/sdk/go/arvados/fs_site.go b/sdk/go/arvados/fs_site.go index b5daf7b883..82114e2ea9 100644 --- a/sdk/go/arvados/fs_site.go +++ b/sdk/go/arvados/fs_site.go @@ -6,6 +6,7 @@ package arvados import ( "os" + "strings" "sync" "time" ) @@ -60,7 +61,7 @@ func (fs *customFileSystem) MountByID(mount string) { mode: 0755 | os.ModeDir, }, }, - create: fs.mountCollection, + create: fs.mountByID, }, nil }) } @@ -123,6 +124,16 @@ func (fs *customFileSystem) newNode(name string, perm os.FileMode, modTime time. return nil, ErrInvalidOperation } +func (fs *customFileSystem) mountByID(parent inode, id string) inode { + if strings.Contains(id, "-4zz18-") || pdhRegexp.MatchString(id) { + return fs.mountCollection(parent, id) + } else if strings.Contains(id, "-j7d0g-") { + return fs.newProjectNode(fs.root, id, id) + } else { + return nil + } +} + func (fs *customFileSystem) mountCollection(parent inode, id string) inode { var coll Collection err := fs.RequestAndDecode(&coll, "GET", "arvados/v1/collections/"+id, nil, nil)