Skip to content

Commit

Permalink
bake: move merge logic to an hcl package and add tests
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Dec 2, 2024
1 parent d6d713a commit ff00ac1
Show file tree
Hide file tree
Showing 13 changed files with 691 additions and 5 deletions.
3 changes: 2 additions & 1 deletion bake/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

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

var pm hclparser.ParseMeta
if len(hclFiles) > 0 {
res, err := hclparser.Parse(hclparser.MergeFiles(hclFiles), hclparser.Opt{
res, err := hclparser.Parse(hclalt.MergeFiles(hclFiles), hclparser.Opt{
LookupVar: os.LookupEnv,
Vars: defaults,
ValidateLabel: validateTargetName,
Expand Down
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.
4 changes: 1 addition & 3 deletions bake/hclparser/merged.go → bake/hclparser/hcl/merged.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Forked from https://github.com/hashicorp/hcl/blob/4679383728fe331fc8a6b46036a27b8f818d9bc0/merged.go

package hclparser
package hcl

import (
"fmt"
Expand Down
Loading

0 comments on commit ff00ac1

Please sign in to comment.