Skip to content

Commit

Permalink
bake: test empty attribute
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 c962c23 commit 252e9e1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bake/bake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,24 @@ target "app" {
})
}

// https://github.com/docker/buildx/pull/428
// https://github.com/docker/buildx/issues/2822
func TestEmptyAttribute(t *testing.T) {
fp := File{
Name: "docker-bake.hcl",
Data: []byte(`
target "app" {
output = [""]
}
`),
}

ctx := context.TODO()

_, _, err := ReadTargets(ctx, []File{fp}, []string{"app"}, nil, nil)
require.NoError(t, err)
}

func stringify[V fmt.Stringer](values []V) []string {
s := make([]string, len(values))
for i, v := range values {
Expand Down

0 comments on commit 252e9e1

Please sign in to comment.