From e689d188b9825600ecea0b4a45a0fea769ba2def Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:29:52 +0100 Subject: [PATCH] bake: test empty attribute Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- bake/bake_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bake/bake_test.go b/bake/bake_test.go index b61e2ecff3e..daca46a655a 100644 --- a/bake/bake_test.go +++ b/bake/bake_test.go @@ -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 {