From 7995f95d0989b3974c9f1d39da4f36c74ae958cf Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 20 Nov 2020 16:01:25 -0500 Subject: [PATCH 1/1] 17154: Copy updates on federated users to local cluster Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- lib/controller/federation/conn.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go index 3ec17c17ed..5571e89e9e 100644 --- a/lib/controller/federation/conn.go +++ b/lib/controller/federation/conn.go @@ -526,7 +526,18 @@ func (conn *Conn) UserUpdate(ctx context.Context, options arvados.UpdateOptions) if options.BypassFederation { return conn.local.UserUpdate(ctx, options) } - return conn.chooseBackend(options.UUID).UserUpdate(ctx, options) + resp, err := conn.chooseBackend(options.UUID).UserUpdate(ctx, options) + if err != nil { + return resp, err + } + if options.UUID[:5] != conn.cluster.ClusterID { + // Copy the updated user record to the local cluster + err = conn.batchUpdateUsers(ctx, arvados.ListOptions{}, []arvados.User{resp}) + if err != nil { + return arvados.User{}, err + } + } + return resp, err } func (conn *Conn) UserUpdateUUID(ctx context.Context, options arvados.UpdateUUIDOptions) (arvados.User, error) { -- 2.30.2