@@ -46,12 +46,12 @@ type slugBuildCase struct {
4646 debug bool
4747 name string
4848 namespace string
49+ env map [string ]interface {}
4950 envSecretName string
5051 tarKey string
5152 putKey string
5253 cacheKey string
5354 gitShortHash string
54- buildPack string
5555 slugBuilderImage string
5656 slugBuilderImagePullPolicy api.PullPolicy
5757 storageType string
@@ -77,6 +77,7 @@ func TestBuildPod(t *testing.T) {
7777
7878 env := make (map [string ]interface {})
7979 env ["KEY" ] = "VALUE"
80+ env ["BUILDPACK_URL" ] = "buildpack"
8081 buildArgsEnv := make (map [string ]interface {})
8182 buildArgsEnv ["DRYCC_DOCKER_BUILD_ARGS_ENABLED" ] = "1"
8283 buildArgsEnv ["KEY" ] = "VALUE"
@@ -93,27 +94,27 @@ func TestBuildPod(t *testing.T) {
9394 nodeSelector2 ["network" ] = "fast"
9495
9596 slugBuilds := []slugBuildCase {
96- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , " " , "" , api .PullAlways , "" , emptyNodeSelector },
97- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , " " , "" , api .PullAlways , "" , emptyNodeSelector },
98- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "" , "deadbeef" , " " , "" , api .PullAlways , "" , emptyNodeSelector },
99- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "buildpack " , "" , api .PullAlways , "" , emptyNodeSelector },
100- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "buildpack " , "" , api .PullAlways , "" , emptyNodeSelector },
101- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "buildpack " , "customimage" , api .PullAlways , "" , nil },
102- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "buildpack " , "customimage" , api .PullIfNotPresent , "" , nodeSelector1 },
103- {true , "test" , "default" , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "buildpack " , "customimage" , api .PullNever , "" , nodeSelector2 },
97+ {true , "test" , "default" , emptyEnv , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "" , api .PullAlways , "" , emptyNodeSelector },
98+ {true , "test" , "default" , emptyEnv , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "" , api .PullAlways , "" , emptyNodeSelector },
99+ {true , "test" , "default" , emptyEnv , envSecretName , "tar" , "put-url" , "" , "deadbeef" , "" , api .PullAlways , "" , emptyNodeSelector },
100+ {true , "test" , "default" , env , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "" , api .PullAlways , "" , emptyNodeSelector },
101+ {true , "test" , "default" , env , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "" , api .PullAlways , "" , emptyNodeSelector },
102+ {true , "test" , "default" , env , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "customimage" , api .PullAlways , "" , nil },
103+ {true , "test" , "default" , env , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "customimage" , api .PullIfNotPresent , "" , nodeSelector1 },
104+ {true , "test" , "default" , env , envSecretName , "tar" , "put-url" , "cache-url" , "deadbeef" , "customimage" , api .PullNever , "" , nodeSelector2 },
104105 }
105106
106107 for _ , build := range slugBuilds {
107108 pod = slugbuilderPod (
108109 build .debug ,
109110 build .name ,
110111 build .namespace ,
112+ build .env ,
111113 build .envSecretName ,
112114 build .tarKey ,
113115 build .putKey ,
114116 build .cacheKey ,
115117 build .gitShortHash ,
116- build .buildPack ,
117118 build .storageType ,
118119 build .slugBuilderImage ,
119120 build .slugBuilderImagePullPolicy ,
@@ -140,10 +141,6 @@ func TestBuildPod(t *testing.T) {
140141 checkForEnv (t , pod , "CACHE_PATH" , build .cacheKey )
141142 }
142143
143- if build .buildPack != "" {
144- checkForEnv (t , pod , "BUILDPACK_URL" , build .buildPack )
145- }
146-
147144 if build .slugBuilderImage != "" {
148145 if pod .Spec .Containers [0 ].Image != build .slugBuilderImage {
149146 t .Errorf ("expected %v but returned %v " , build .slugBuilderImage , pod .Spec .Containers [0 ].Image )
0 commit comments