[ARVADOS] created: 2.1.0-446-g3c6bd20ff

Git user git at public.arvados.org
Fri Feb 26 16:20:22 UTC 2021


        at  3c6bd20ffd59492548c0608943518cb2b4325054 (commit)


commit 3c6bd20ffd59492548c0608943518cb2b4325054
Author: Ward Vandewege <ward at curii.com>
Date:   Fri Feb 26 11:19:57 2021 -0500

    17119: make controller understand filter groups.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/controller/rpc/conn.go b/lib/controller/rpc/conn.go
index b3713d938..9730ab15a 100644
--- a/lib/controller/rpc/conn.go
+++ b/lib/controller/rpc/conn.go
@@ -445,9 +445,25 @@ func (conn *Conn) GroupList(ctx context.Context, options arvados.ListOptions) (a
 }
 
 func (conn *Conn) GroupContents(ctx context.Context, options arvados.GroupContentsOptions) (arvados.ObjectList, error) {
-	ep := arvados.EndpointGroupContents
 	var resp arvados.ObjectList
-	err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
+	ep := arvados.EndpointGroupContents
+
+	// Get the group object
+	epGet := arvados.EndpointGroupGet
+	var respGroup arvados.Group
+	err := conn.requestAndDecode(ctx, &respGroup, epGet, nil, options)
+	if err != nil {
+		return resp, err
+	}
+
+	// If the group has groupClass 'filter', apply the filters before getting the contents.
+	if respGroup.GroupClass == "filter" {
+		if filters, ok := respGroup.Properties["filters"]; ok {
+			options.Filters = append(options.Filters, filters.([]arvados.Filter)...)
+		}
+	}
+
+	err = conn.requestAndDecode(ctx, &resp, ep, nil, options)
 	return resp, err
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list