mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-30 23:28:04 +08:00
bake: support null label value
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -1296,11 +1296,18 @@ func TestHCLNullVars(t *testing.T) {
|
||||
`variable "FOO" {
|
||||
default = null
|
||||
}
|
||||
variable "BAR" {
|
||||
default = null
|
||||
}
|
||||
target "default" {
|
||||
args = {
|
||||
foo = FOO
|
||||
bar = "baz"
|
||||
}
|
||||
labels = {
|
||||
"com.docker.app.bar" = BAR
|
||||
"com.docker.app.baz" = "foo"
|
||||
}
|
||||
}`),
|
||||
}
|
||||
|
||||
@@ -1315,6 +1322,7 @@ func TestHCLNullVars(t *testing.T) {
|
||||
_, err = TargetsToBuildOpt(m, &Input{})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, map[string]*string{"bar": ptrstr("baz")}, m["default"].Args)
|
||||
require.Equal(t, map[string]*string{"com.docker.app.baz": ptrstr("foo")}, m["default"].Labels)
|
||||
}
|
||||
|
||||
func TestJSONNullVars(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user