Merge branch '19088-s3-properties-tags'
[arvados.git] / sdk / go / arvados / fs_site.go
index 0a561f667a0b4a6e12f8692d1a16ba6dff0b37f1..bb2eee77925fd2c682c7d42e1e8e175c4f2f1489 100644 (file)
@@ -161,7 +161,8 @@ func (fs *customFileSystem) mountCollection(parent inode, id string) inode {
        return cfs
 }
 
-func (fs *customFileSystem) newProjectNode(root inode, name, uuid string, properties map[string]interface{}) inode {
+func (fs *customFileSystem) newProjectNode(root inode, name, uuid string, proj *Group) inode {
+       var projLoading sync.Mutex
        return &lookupnode{
                stale:   fs.Stale,
                loadOne: func(parent inode, name string) (inode, error) { return fs.projectsLoadOne(parent, uuid, name) },
@@ -174,10 +175,19 @@ func (fs *customFileSystem) newProjectNode(root inode, name, uuid string, proper
                                name:    name,
                                modTime: time.Now(),
                                mode:    0755 | os.ModeDir,
-                               sys: &Group{
-                                       GroupClass: "project",
-                                       UUID:       uuid,
-                                       Properties: properties,
+                               sys: func() interface{} {
+                                       projLoading.Lock()
+                                       defer projLoading.Unlock()
+                                       if proj != nil {
+                                               return proj
+                                       }
+                                       var g Group
+                                       err := fs.RequestAndDecode(&g, "GET", "arvados/v1/groups/"+uuid, nil, nil)
+                                       if err != nil {
+                                               return err
+                                       }
+                                       proj = &g
+                                       return proj
                                },
                        },
                },