@@ -61,6 +61,9 @@ func TestBuildPod(t *testing.T) {
6161
6262 env := make (map [string ]interface {})
6363 env ["KEY" ] = "VALUE"
64+ buildArgsEnv := make (map [string ]interface {})
65+ buildArgsEnv ["DEIS_DOCKER_BUILD_ARGS_ENABLED" ] = "1"
66+ buildArgsEnv ["KEY" ] = "VALUE"
6467 envSecretName := "test-build-env"
6568 var pod * api.Pod
6669
@@ -149,6 +152,7 @@ func TestBuildPod(t *testing.T) {
149152 {true , "test" , "default" , env , "tar" , "deadbeef" , "img" , "customimage" , api .PullAlways , "" , emptyNodeSelector },
150153 {true , "test" , "default" , env , "tar" , "deadbeef" , "img" , "customimage" , api .PullIfNotPresent , "" , emptyNodeSelector },
151154 {true , "test" , "default" , env , "tar" , "deadbeef" , "img" , "customimage" , api .PullNever , "" , nil },
155+ {true , "test" , "default" , buildArgsEnv , "tar" , "deadbeef" , "img" , "customimage" , api .PullIfNotPresent , "" , emptyNodeSelector },
152156 }
153157 regEnv := map [string ]string {"REG_LOC" : "on-cluster" }
154158 for _ , build := range dockerBuilds {
@@ -180,6 +184,9 @@ func TestBuildPod(t *testing.T) {
180184 checkForEnv (t , pod , "TAR_PATH" , build .tarKey )
181185 checkForEnv (t , pod , "IMG_NAME" , build .imgName )
182186 checkForEnv (t , pod , "REG_LOC" , "on-cluster" )
187+ if _ , ok := build .env ["DEIS_DOCKER_BUILD_ARGS_ENABLED" ]; ok {
188+ checkForEnv (t , pod , "DOCKER_BUILD_ARGS" , `{"DEIS_DOCKER_BUILD_ARGS_ENABLED":"1","KEY":"VALUE"}` )
189+ }
183190 if build .dockerBuilderImage != "" {
184191 if pod .Spec .Containers [0 ].Image != build .dockerBuilderImage {
185192 t .Errorf ("expected %v but returned %v" , build .dockerBuilderImage , pod .Spec .Containers [0 ].Image )
0 commit comments