Skip to content

Commit ff00ac1

Browse files
committed
bake: move merge logic to an hcl package and add tests
Signed-off-by: CrazyMax <[email protected]>
1 parent d6d713a commit ff00ac1

13 files changed

+691
-5
lines changed

bake/bake.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616

1717
composecli "github.com/compose-spec/compose-go/v2/cli"
1818
"github.com/docker/buildx/bake/hclparser"
19+
hclalt "github.com/docker/buildx/bake/hclparser/hcl"
1920
"github.com/docker/buildx/build"
2021
controllerapi "github.com/docker/buildx/controller/pb"
2122
"github.com/docker/buildx/util/buildflags"
@@ -343,7 +344,7 @@ func ParseFiles(files []File, defaults map[string]string) (_ *Config, _ *hclpars
343344

344345
var pm hclparser.ParseMeta
345346
if len(hclFiles) > 0 {
346-
res, err := hclparser.Parse(hclparser.MergeFiles(hclFiles), hclparser.Opt{
347+
res, err := hclparser.Parse(hclalt.MergeFiles(hclFiles), hclparser.Opt{
347348
LookupVar: os.LookupEnv,
348349
Vars: defaults,
349350
ValidateLabel: validateTargetName,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

bake/hclparser/merged.go bake/hclparser/hcl/merged.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Copyright (c) HashiCorp, Inc.
22
// SPDX-License-Identifier: MPL-2.0
33

4-
// Forked from https://github.com/hashicorp/hcl/blob/4679383728fe331fc8a6b46036a27b8f818d9bc0/merged.go
5-
6-
package hclparser
4+
package hcl
75

86
import (
97
"fmt"

0 commit comments

Comments
 (0)