[ARVADOS] updated: 2.1.0-1214-g913c7638c

Git user git at public.arvados.org
Thu Aug 26 21:03:57 UTC 2021


Summary of changes:
 lib/controller/integration_test.go   | 11 +++++++++++
 sdk/go/keepclient/keepclient.go      | 11 ++++++-----
 sdk/go/keepclient/keepclient_test.go |  3 +--
 3 files changed, 18 insertions(+), 7 deletions(-)

       via  913c7638cb04e1efae5fce4d2fe405c7ce71e7d9 (commit)
      from  3b492e126b3c429086d4e183ddb9704da5bc9e96 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 913c7638cb04e1efae5fce4d2fe405c7ce71e7d9
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Thu Aug 26 18:02:01 2021 -0300

    17696: Moves default storage classes loading to keepclient.New().
    
    Also adds integration test that proves that a collection and its keepclient
    use the same default storage classes list.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index 26f0dbb0d..b09bfb898 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -149,6 +149,16 @@ func (s *IntegrationSuite) TearDownSuite(c *check.C) {
 	}
 }
 
+func (s *IntegrationSuite) TestDefaultStorageClassesOnCollections(c *check.C) {
+	conn := s.testClusters["z1111"].Conn()
+	rootctx, _, _ := s.testClusters["z1111"].RootClients()
+	userctx, _, kc, _ := s.testClusters["z1111"].UserClients(rootctx, c, conn, s.oidcprovider.AuthEmail, true)
+	c.Assert(len(kc.DefaultStorageClasses) > 0, check.Equals, true)
+	coll, err := conn.CollectionCreate(userctx, arvados.CreateOptions{})
+	c.Assert(err, check.IsNil)
+	c.Assert(coll.StorageClassesDesired, check.DeepEquals, kc.DefaultStorageClasses)
+}
+
 func (s *IntegrationSuite) TestGetCollectionByPDH(c *check.C) {
 	conn1 := s.testClusters["z1111"].Conn()
 	rootctx1, _, _ := s.testClusters["z1111"].RootClients()
@@ -632,6 +642,7 @@ func (s *IntegrationSuite) TestListUsers(c *check.C) {
 	for _, user := range lst.Items {
 		if user.Username == "" {
 			nullUsername = true
+			break
 		}
 	}
 	c.Assert(nullUsername, check.Equals, true)
diff --git a/sdk/go/keepclient/keepclient.go b/sdk/go/keepclient/keepclient.go
index 4baebbd8a..68ac886dd 100644
--- a/sdk/go/keepclient/keepclient.go
+++ b/sdk/go/keepclient/keepclient.go
@@ -141,10 +141,6 @@ func (kc *KeepClient) loadDefaultClasses() error {
 // use.
 func MakeKeepClient(arv *arvadosclient.ArvadosClient) (*KeepClient, error) {
 	kc := New(arv)
-	err := kc.loadDefaultClasses()
-	if err != nil {
-		DebugPrintf("DEBUG: Unable to load the default storage classes cluster config")
-	}
 	return kc, kc.discoverServices()
 }
 
@@ -159,11 +155,16 @@ func New(arv *arvadosclient.ArvadosClient) *KeepClient {
 			defaultReplicationLevel = int(v)
 		}
 	}
-	return &KeepClient{
+	kc := &KeepClient{
 		Arvados:       arv,
 		Want_replicas: defaultReplicationLevel,
 		Retries:       2,
 	}
+	err = kc.loadDefaultClasses()
+	if err != nil {
+		DebugPrintf("DEBUG: Unable to load the default storage classes cluster config")
+	}
+	return kc
 }
 
 // PutHR puts a block given the block hash, a reader, and the number of bytes
diff --git a/sdk/go/keepclient/keepclient_test.go b/sdk/go/keepclient/keepclient_test.go
index ed2cee645..9000b2f50 100644
--- a/sdk/go/keepclient/keepclient_test.go
+++ b/sdk/go/keepclient/keepclient_test.go
@@ -84,8 +84,7 @@ func (s *ServerRequiredSuite) TestDefaultStorageClasses(c *C) {
 	c.Assert(cc, NotNil)
 	c.Assert(cc.(map[string]interface{})["default"], NotNil)
 
-	kc, err := MakeKeepClient(arv)
-	c.Assert(err, IsNil)
+	kc := New(arv)
 	c.Assert(kc.DefaultStorageClasses, DeepEquals, []string{"default"})
 }
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list