Address review comments
This commit is contained in:
parent
e0566237a4
commit
71e6550f81
|
@ -1015,9 +1015,8 @@ func parsePlugins(result *[]*config.PluginConfig, list *ast.ObjectList) error {
|
|||
listVal := list.Items[i]
|
||||
|
||||
// Deal with json->hcl AST parsing incorrectness when directly nested
|
||||
// items show up as additional keys. This currently only affects plugin
|
||||
// configuration because args is not necessary. All other fields in the config
|
||||
// have multiple keys and parse from json into the AST correctly.
|
||||
// items show up as additional keys.
|
||||
// TODO(preetha): Add additional tests and fix other places that have the same issue
|
||||
unwrapLegacyHCLObjectKeysFromJSON(listVal, 1)
|
||||
if err := helper.CheckHCLKeys(listVal.Val, valid); err != nil {
|
||||
return fmt.Errorf("invalid keys in plugin config %d: %v", i+1, err)
|
||||
|
|
|
@ -657,7 +657,7 @@ func TestConfig_Parse(t *testing.T) {
|
|||
for _, tc := range cases {
|
||||
t.Run(tc.File, func(t *testing.T) {
|
||||
require := require.New(t)
|
||||
path, err := filepath.Abs(filepath.Join("./config-test-fixtures", tc.File))
|
||||
path, err := filepath.Abs(filepath.Join("./testdata", tc.File))
|
||||
if err != nil {
|
||||
t.Fatalf("file: %s\n\n%s", tc.File, err)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# This file was used to generate basic.json from https://www.hcl2json.com/
|
||||
region = "foobar"
|
||||
datacenter = "dc2"
|
||||
name = "my-web"
|
Loading…
Reference in a new issue