Skip to content

Commit

Permalink
bake: additional test for empty variable
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 27, 2024
1 parent cd017e9 commit 8b02962
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bake/bake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2008,3 +2008,23 @@ target "app" {
require.Contains(t, err.Error(), "FOO must be greater than 5.")
})
}

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

ctx := context.TODO()

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

0 comments on commit 8b02962

Please sign in to comment.