From 61112d8af73d99e61306c11a9ef6af34e7fe0b62 Mon Sep 17 00:00:00 2001 From: Xiaokang Wang Date: Fri, 20 Nov 2020 18:50:46 +0000 Subject: [PATCH] Workaround for muti-json's hard coded override method (#409) * Simple workaround for muti-json unable to automatically understand new config options. * Update jsonem.go --- main/jsonem/jsonem.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/jsonem/jsonem.go b/main/jsonem/jsonem.go index 6000e2853..a289b2ae6 100644 --- a/main/jsonem/jsonem.go +++ b/main/jsonem/jsonem.go @@ -19,12 +19,18 @@ func init() { switch v := input.(type) { case cmdarg.Arg: cf := &conf.Config{} - for _, arg := range v { + for i, arg := range v { newError("Reading config: ", arg).AtInfo().WriteToLog() r, err := confloader.LoadConfig(arg) common.Must(err) c, err := serial.DecodeJSONConfig(r) common.Must(err) + if i == 0 { + // This ensure even if the muti-json parser do not support a setting, + // It is still respected automatically for the first configure file + *cf = *c + continue + } cf.Override(c, arg) } return cf.Build()