16778: Make a copy of options
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 4 Sep 2020 15:25:15 +0000 (11:25 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 4 Sep 2020 15:25:15 +0000 (11:25 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

lib/controller/federation/conn.go

index a84f1b0171307744a36f2b3fce4b53307bae8755..d715734c6506acc5090f88cf2c7b1a8b1053bdb4 100644 (file)
@@ -486,20 +486,14 @@ func (conn *Conn) UserSetup(ctx context.Context, options arvados.UserSetupOption
                // it should be created on the local cluster,
                // not the remote one.
 
-               setupVM := options.VMUUID
-               setupRepo := options.RepoName
-               options.VMUUID = ""
-               options.RepoName = ""
+               upstreamOptions := options
+               upstreamOptions.VMUUID = ""
+               upstreamOptions.RepoName = ""
 
-               ret, err := upstream.UserSetup(ctx, options)
+               ret, err := upstream.UserSetup(ctx, upstreamOptions)
                if err != nil {
                        return ret, err
                }
-
-               // Restore VMUUID and RepoName for the call to local
-               // UserSetup below.
-               options.VMUUID = setupVM
-               options.RepoName = setupRepo
        }
 
        return conn.local.UserSetup(ctx, options)