[ARVADOS] created: 1.3.0-3292-gab9833a2d

Git user git at public.arvados.org
Thu Oct 8 21:02:29 UTC 2020


        at  ab9833a2d881e18f15bf6c9d39126afbcd0a48c9 (commit)


commit ab9833a2d881e18f15bf6c9d39126afbcd0a48c9
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Thu Oct 8 18:01:09 2020 -0300

    16981: Retrieves the local clusterID from exported config.
    
    Also, fixed tests by not starting a new api server and using what run-tests
    provides.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/tools/sync-groups/sync-groups.go b/tools/sync-groups/sync-groups.go
index 4d03ba89e..5fdd82bfa 100644
--- a/tools/sync-groups/sync-groups.go
+++ b/tools/sync-groups/sync-groups.go
@@ -275,7 +275,13 @@ func GetConfig() (config ConfigParams, err error) {
 	if !u.IsActive || !u.IsAdmin {
 		return config, fmt.Errorf("current user (%s) is not an active admin user", u.UUID)
 	}
-	config.SysUserUUID = u.UUID[:12] + "000000000000000"
+
+	var ac struct{ ClusterID string }
+	err = config.Client.RequestAndDecode(&ac, "GET", "arvados/v1/config", nil, nil)
+	if err != nil {
+		return config, fmt.Errorf("error getting the exported config: %s", err)
+	}
+	config.SysUserUUID = ac.ClusterID + "-tpzed-000000000000000"
 
 	// Set up remote groups' parent
 	if err = SetParentGroup(&config); err != nil {
diff --git a/tools/sync-groups/sync-groups_test.go b/tools/sync-groups/sync-groups_test.go
index 2da8c1cdd..ec2f18a30 100644
--- a/tools/sync-groups/sync-groups_test.go
+++ b/tools/sync-groups/sync-groups_test.go
@@ -26,14 +26,6 @@ type TestSuite struct {
 	users map[string]arvados.User
 }
 
-func (s *TestSuite) SetUpSuite(c *C) {
-	arvadostest.StartAPI()
-}
-
-func (s *TestSuite) TearDownSuite(c *C) {
-	arvadostest.StopAPI()
-}
-
 func (s *TestSuite) SetUpTest(c *C) {
 	ac := arvados.NewClientFromEnv()
 	u, err := ac.CurrentUser()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list