Merge pull request #29104 from duglin/Issue29084

Fix processing of unset build-args during build
This commit is contained in:
Tõnis Tiigi 2016-12-07 17:18:55 -08:00 committed by GitHub
commit 50d32cdc08
1 changed files with 7 additions and 4 deletions

View File

@ -27,6 +27,8 @@ func TestImageBuildError(t *testing.T) {
}
func TestImageBuild(t *testing.T) {
v1 := "value1"
v2 := "value2"
emptyRegistryConfig := "bnVsbA=="
buildCases := []struct {
buildOptions types.ImageBuildOptions
@ -105,13 +107,14 @@ func TestImageBuild(t *testing.T) {
},
{
buildOptions: types.ImageBuildOptions{
BuildArgs: map[string]string{
"ARG1": "value1",
"ARG2": "value2",
BuildArgs: map[string]*string{
"ARG1": &v1,
"ARG2": &v2,
"ARG3": nil,
},
},
expectedQueryParams: map[string]string{
"buildargs": `{"ARG1":"value1","ARG2":"value2"}`,
"buildargs": `{"ARG1":"value1","ARG2":"value2","ARG3":null}`,
"rm": "0",
},
expectedTags: []string{},