X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f827088cc812a217bfb46aca66be62b79b7ed973..9a1056497d7b7ad18769336489d3a6822547b65a:/sdk/go/arvados/vocabulary.go diff --git a/sdk/go/arvados/vocabulary.go b/sdk/go/arvados/vocabulary.go index dc31b998f6..150091b308 100644 --- a/sdk/go/arvados/vocabulary.go +++ b/sdk/go/arvados/vocabulary.go @@ -112,13 +112,14 @@ func (v *Vocabulary) validate() error { if tagValues[lcVal] != "" { return fmt.Errorf("duplicate tag value %q for tag %q", val, key) } + // Checks for collisions between labels from different values. tagValues[lcVal] = val for _, tagLbl := range v.Tags[key].Values[val].Labels { label := strings.ToLower(tagLbl.Label) - if tagValues[label] != "" { - return fmt.Errorf("tag value label %q for pair (%q:%q) already seen as a value key or label", tagLbl.Label, key, val) + if tagValues[label] != "" && tagValues[label] != val { + return fmt.Errorf("tag value label %q for pair (%q:%q) already seen on value %q", tagLbl.Label, key, val, tagValues[label]) } - tagValues[label] = tagLbl.Label + tagValues[label] = val } } } @@ -208,11 +209,11 @@ func (v *Vocabulary) Check(data map[string]interface{}) error { return err } default: - return fmt.Errorf("tag value of type %T for key %q is not a valid", singleVal, key) + return fmt.Errorf("value list element type for tag key %q was %T, but expected a string", key, singleVal) } } default: - return fmt.Errorf("tag value of type %T for key %q is not a valid", val, key) + return fmt.Errorf("value type for tag key %q was %T, but expected a string or list of strings", key, val) } } return nil