Skip to content

Commit

Permalink
fix: Unmarshal error for Dockerfile in parse_config builtins (#887)
Browse files Browse the repository at this point in the history
Parsed Dockerfiles are an array at the root, not a map.

Signed-off-by: James Alseth <james@jalseth.me>
  • Loading branch information
jalseth committed Nov 26, 2023
1 parent 5326a5a commit 1815e91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtins/parse_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func parseConfig(bctx rego.BuiltinContext, op1, op2 *ast.Term) (*ast.Term, error
if err != nil {
return nil, fmt.Errorf("create config parser: %w", err)
}
var cfg map[string]any
var cfg any
if err := parser.Unmarshal([]byte(config), &cfg); err != nil {
return nil, fmt.Errorf("unmarshal config: %w", err)
}
Expand All @@ -92,7 +92,7 @@ func parseConfigFile(bctx rego.BuiltinContext, op1 *ast.Term) (*ast.Term, error)
return nil, fmt.Errorf("read config file %s: %w", filePath, err)
}

var cfg map[string]any
var cfg any
if err := parser.Unmarshal(contents, &cfg); err != nil {
return nil, fmt.Errorf("unmarshal config: %w", err)
}
Expand Down

0 comments on commit 1815e91

Please sign in to comment.