mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
bake: additional test for empty variable
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
cd017e98ed
commit
8b029626f3
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user