[ARVADOS] updated: 1.3.0-1310-g7f2569f2e
Git user
git at public.curoverse.com
Fri Jul 12 19:05:17 UTC 2019
Summary of changes:
build/run-tests.sh | 4 +-
cmd/arvados-client/cmd.go | 9 ++-
cmd/arvados-server/cmd.go | 7 +--
lib/cloud/cloudtest/cmd.go | 4 +-
lib/cmd/cmd.go | 13 +++-
lib/config/cmd.go | 75 +++++++++++-----------
lib/config/cmd_test.go | 31 +++++++--
lib/config/deprecated.go | 51 +++++++++++++--
lib/config/export_test.go | 5 +-
lib/config/load.go | 152 ++++++++++++++++++++++++++++++++++++---------
lib/config/load_test.go | 140 +++++++++++++++++++++++++++++++++++------
lib/service/cmd.go | 16 +++--
sdk/go/arvados/config.go | 9 ++-
13 files changed, 399 insertions(+), 117 deletions(-)
via 7f2569f2e9900348dc76b495c9a416fe339593ae (commit)
via e723b02bc8e5382575f27b0ce803f775adf6d479 (commit)
via 3310da050bd763055a67b2395f122ab5c01cbdf9 (commit)
via 05eca3060c7200e47dd83cdcf8f4f7bcad14f62f (commit)
via 3a81f54c8c0da6babdfb9014a64079b6b41f73c7 (commit)
via aa6dd2b23c738ebe01cdbaed86ef24ce343b29ae (commit)
via 0c894574ca46b77209127a4908844c2e0e734cea (commit)
via 3d98f9b1196260dbc7b9963dfd295d7e330e23d6 (commit)
from e843017b451f1270c58539512e227c4da5656e25 (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 7f2569f2e9900348dc76b495c9a416fe339593ae
Merge: e843017b4 e723b02bc
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Fri Jul 12 15:05:06 2019 -0400
Merge branch '13647-load-old-config'
refs #13647
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --cc lib/config/load.go
index ee9cdd60f,347875e8e..168c1aa22
--- a/lib/config/load.go
+++ b/lib/config/load.go
@@@ -156,15 -252,11 +252,15 @@@ func (ldr *Loader) logExtraKeys(expecte
allowed[strings.ToLower(k)] = v
}
for k, vsupp := range supplied {
+ if k == "SAMPLE" {
+ // entry will be dropped in removeSampleKeys anyway
+ continue
+ }
vexp, ok := allowed[strings.ToLower(k)]
- if !ok && expected["SAMPLE"] != nil {
+ if expected["SAMPLE"] != nil {
vexp = expected["SAMPLE"]
} else if !ok {
- log.Warnf("deprecated or unknown config entry: %s%s", prefix, k)
+ ldr.Logger.Warnf("deprecated or unknown config entry: %s%s", prefix, k)
continue
}
if vsupp, ok := vsupp.(map[string]interface{}); !ok {
diff --cc lib/config/load_test.go
index 6e8b6208d,2d60f9e5b..eea3efbd9
--- a/lib/config/load_test.go
+++ b/lib/config/load_test.go
@@@ -6,10 -6,11 +6,12 @@@ package confi
import (
"bytes"
+ "fmt"
"io"
+ "io/ioutil"
"os"
"os/exec"
+ "reflect"
"strings"
"testing"
@@@ -98,49 -199,13 +200,49 @@@ Clusters
c.Check(logs, check.HasLen, 2)
}
+func (s *LoadSuite) checkSAMPLEKeys(c *check.C, path string, x interface{}) {
+ v := reflect.Indirect(reflect.ValueOf(x))
+ switch v.Kind() {
+ case reflect.Map:
+ var stringKeys, sampleKey bool
+ iter := v.MapRange()
+ for iter.Next() {
+ k := iter.Key()
+ if k.Kind() == reflect.String {
+ stringKeys = true
+ if k.String() == "SAMPLE" || k.String() == "xxxxx" {
+ sampleKey = true
+ s.checkSAMPLEKeys(c, path+"."+k.String(), iter.Value().Interface())
+ }
+ }
+ }
+ if stringKeys && !sampleKey {
+ c.Errorf("%s is a map with string keys (type %T) but config.default.yml has no SAMPLE key", path, x)
+ }
+ return
+ case reflect.Struct:
+ for i := 0; i < v.NumField(); i++ {
+ val := v.Field(i)
+ if val.CanInterface() {
+ s.checkSAMPLEKeys(c, path+"."+v.Type().Field(i).Name, val.Interface())
+ }
+ }
+ }
+}
+
+func (s *LoadSuite) TestDefaultConfigHasAllSAMPLEKeys(c *check.C) {
+ cfg, err := Load(bytes.NewBuffer(DefaultYAML), ctxlog.TestLogger(c))
+ c.Assert(err, check.IsNil)
+ s.checkSAMPLEKeys(c, "", cfg)
+}
+
func (s *LoadSuite) TestNoUnrecognizedKeysInDefaultConfig(c *check.C) {
var logbuf bytes.Buffer
- logger := logrus.New()
- logger.Out = &logbuf
var supplied map[string]interface{}
yaml.Unmarshal(DefaultYAML, &supplied)
- cfg, err := Load(bytes.NewBuffer(DefaultYAML), logger)
+
+ loader := testLoader(c, string(DefaultYAML), &logbuf)
+ cfg, err := loader.Load()
c.Assert(err, check.IsNil)
var loaded map[string]interface{}
buf, err := yaml.Marshal(cfg)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list