[ARVADOS] updated: 2.1.0-1504-geb2ad4035

Git user git at public.arvados.org
Wed Oct 27 21:13:24 UTC 2021


Summary of changes:
 lib/controller/localdb/conn.go    | 14 ++++++++++----
 sdk/go/arvados/vocabulary.go      |  4 ++--
 sdk/go/arvados/vocabulary_test.go |  2 +-
 3 files changed, 13 insertions(+), 7 deletions(-)

       via  eb2ad403584404052875a286edec4a53b57c7192 (commit)
      from  5257fa18336a68881038e0cfb75a06d3c8dd3903 (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 eb2ad403584404052875a286edec4a53b57c7192
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Wed Oct 27 18:13:03 2021 -0300

    17944: Fixes tests.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/lib/controller/localdb/conn.go b/lib/controller/localdb/conn.go
index b6bdf0de6..a26381f74 100644
--- a/lib/controller/localdb/conn.go
+++ b/lib/controller/localdb/conn.go
@@ -38,11 +38,17 @@ func (conn *Conn) checkProperties(properties interface{}) error {
 	if properties == nil {
 		return nil
 	}
-	// Check provided properties against the vocabulary.
 	var props map[string]interface{}
-	err := json.Unmarshal([]byte(properties.(string)), &props)
-	if err != nil {
-		return err
+	switch properties := properties.(type) {
+	case string:
+		err := json.Unmarshal([]byte(properties), &props)
+		if err != nil {
+			return err
+		}
+	case map[string]interface{}:
+		props = properties
+	default:
+		return fmt.Errorf("unexpected properties type %T", properties)
 	}
 	return conn.cluster.API.Vocabulary.Check(props)
 }
diff --git a/sdk/go/arvados/vocabulary.go b/sdk/go/arvados/vocabulary.go
index cf40eb6ff..336927282 100644
--- a/sdk/go/arvados/vocabulary.go
+++ b/sdk/go/arvados/vocabulary.go
@@ -168,11 +168,11 @@ func (v *Vocabulary) Check(data map[string]interface{}) error {
 						return err
 					}
 				default:
-					return fmt.Errorf("tag value %q for key %q is not a valid type (%v)", singleVal, key, reflect.TypeOf(singleVal))
+					return fmt.Errorf("tag value %q for key %q is not a valid type (%T)", singleVal, key, singleVal)
 				}
 			}
 		default:
-			return fmt.Errorf("tag value %q for key %q is not a valid type (%v)", val, key, reflect.TypeOf(val))
+			return fmt.Errorf("tag value %q for key %q is not a valid type (%T)", val, key, val)
 		}
 	}
 	return nil
diff --git a/sdk/go/arvados/vocabulary_test.go b/sdk/go/arvados/vocabulary_test.go
index 3730e997e..043c37139 100644
--- a/sdk/go/arvados/vocabulary_test.go
+++ b/sdk/go/arvados/vocabulary_test.go
@@ -203,7 +203,7 @@ func (s *VocabularySuite) TestValidationErrors(c *check.C) {
 					},
 				},
 			},
-			"tag value label.*for value.*already seen.*",
+			"tag value label.*for pair.*already seen.*",
 		},
 		{
 			"Strict key, no values",

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list