[ARVADOS] updated: 2.1.0-1839-g4f1341cf0

Git user git at public.arvados.org
Mon Jan 24 20:19:41 UTC 2022


Summary of changes:
 lib/config/cmd.go      | 53 ++++++++++++++++++++++++++------------------------
 lib/config/cmd_test.go |  2 +-
 2 files changed, 29 insertions(+), 26 deletions(-)

       via  4f1341cf015b21d95ec3475cbfe0ae82e73d8b2b (commit)
      from  b701b0f381b46844559c87c235656333b5628dcf (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 4f1341cf015b21d95ec3475cbfe0ae82e73d8b2b
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Mon Jan 24 17:18:07 2022 -0300

    18487: Logs vocabulary validating error messages along with other checks.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/lib/config/cmd.go b/lib/config/cmd.go
index 56a74a21c..528d748c8 100644
--- a/lib/config/cmd.go
+++ b/lib/config/cmd.go
@@ -109,6 +109,34 @@ func (checkCommand) RunCommand(prog string, args []string, stdin io.Reader, stdo
 	if err != nil {
 		return 1
 	}
+
+	// Check for configured vocabulary validity.
+	for id, cc := range withDepr.Clusters {
+		if cc.API.VocabularyPath == "" {
+			continue
+		}
+		vd, err := os.ReadFile(cc.API.VocabularyPath)
+		if err != nil {
+			if errors.Is(err, os.ErrNotExist) {
+				// If the vocabulary path doesn't exist, it might mean that
+				// the current node isn't the controller; so it's not an
+				// error.
+				continue
+			}
+			logger.Errorf("Error reading vocabulary file %q for cluster %s: %s\n", cc.API.VocabularyPath, id, err)
+			continue
+		}
+		mk := make([]string, 0, len(cc.Collections.ManagedProperties))
+		for k := range cc.Collections.ManagedProperties {
+			mk = append(mk, k)
+		}
+		_, err = arvados.NewVocabulary(vd, mk)
+		if err != nil {
+			logger.Errorf("Error loading vocabulary file %q for cluster %s:\n%s\n", cc.API.VocabularyPath, id, err)
+			continue
+		}
+	}
+
 	cmd := exec.Command("diff", "-u", "--label", "without-deprecated-configs", "--label", "relying-on-deprecated-configs", "/dev/fd/3", "/dev/fd/4")
 	for _, obj := range []interface{}{withoutDepr, withDepr} {
 		y, _ := yaml.Marshal(obj)
@@ -144,31 +172,6 @@ func (checkCommand) RunCommand(prog string, args []string, stdin io.Reader, stdo
 			return 1
 		}
 	}
-	for id, cc := range withDepr.Clusters {
-		if cc.API.VocabularyPath == "" {
-			continue
-		}
-		vd, err := os.ReadFile(cc.API.VocabularyPath)
-		if err != nil {
-			if errors.Is(err, os.ErrNotExist) {
-				// If the vocabulary path doesn't exist, it might mean that
-				// the current node isn't the controller; so it's not an
-				// error.
-				continue
-			}
-			fmt.Fprintf(stderr, "Error reading vocabulary file %q for cluster %s: %s\n", cc.API.VocabularyPath, id, err)
-			return 1
-		}
-		mk := make([]string, 0, len(cc.Collections.ManagedProperties))
-		for k := range cc.Collections.ManagedProperties {
-			mk = append(mk, k)
-		}
-		_, err = arvados.NewVocabulary(vd, mk)
-		if err != nil {
-			fmt.Fprintf(stderr, "Error loading vocabulary file %q for cluster %s:\n%s\n", cc.API.VocabularyPath, id, err)
-			return 1
-		}
-	}
 	return 0
 }
 
diff --git a/lib/config/cmd_test.go b/lib/config/cmd_test.go
index 2bb596a05..7167982cc 100644
--- a/lib/config/cmd_test.go
+++ b/lib/config/cmd_test.go
@@ -129,7 +129,7 @@ Clusters:
 `
 	code := CheckCommand.RunCommand("arvados config-check", []string{"-config", "-"}, bytes.NewBufferString(in), &stdout, &stderr)
 	c.Check(code, check.Equals, 1)
-	c.Check(stderr.String(), check.Matches, `(?s).*Error loading vocabulary file.*for cluster.*\nduplicate JSON key "tags.IDfoo".*`)
+	c.Check(stderr.String(), check.Matches, `(?ms).*Error loading vocabulary file.*for cluster.*duplicate JSON key.*tags.IDfoo.*`)
 }
 
 func (s *CommandSuite) TestCheck_DeprecatedKeys(c *check.C) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list