File tree 2 files changed +10
-1
lines changed 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -382,6 +382,7 @@ type BuildConfigSpecParams struct {
382
382
ImageStreamTagName string
383
383
GitURL string
384
384
GitRef string
385
+ ContextDir string
385
386
BuildStrategy buildv1.BuildStrategy
386
387
}
387
388
@@ -401,7 +402,8 @@ func getBuildConfigSpec(buildConfigSpecParams BuildConfigSpecParams) *buildv1.Bu
401
402
URI : buildConfigSpecParams .GitURL ,
402
403
Ref : buildConfigSpecParams .GitRef ,
403
404
},
404
- Type : buildv1 .BuildSourceGit ,
405
+ ContextDir : buildConfigSpecParams .ContextDir ,
406
+ Type : buildv1 .BuildSourceGit ,
405
407
},
406
408
Strategy : buildConfigSpecParams .BuildStrategy ,
407
409
},
Original file line number Diff line number Diff line change @@ -1249,6 +1249,7 @@ func TestGetBuildConfigSpec(t *testing.T) {
1249
1249
name string
1250
1250
GitURL string
1251
1251
GitRef string
1252
+ ContextDir string
1252
1253
buildStrategy buildv1.BuildStrategy
1253
1254
}{
1254
1255
{
@@ -1261,6 +1262,7 @@ func TestGetBuildConfigSpec(t *testing.T) {
1261
1262
name : "Case 2: Get a Docker Strategy Build Config" ,
1262
1263
GitURL : "url" ,
1263
1264
GitRef : "ref" ,
1265
+ ContextDir : "./" ,
1264
1266
buildStrategy : GetDockerBuildStrategy ("dockerfilePath" , []corev1.EnvVar {}),
1265
1267
},
1266
1268
}
@@ -1272,6 +1274,7 @@ func TestGetBuildConfigSpec(t *testing.T) {
1272
1274
BuildStrategy : tt .buildStrategy ,
1273
1275
GitURL : tt .GitURL ,
1274
1276
GitRef : tt .GitRef ,
1277
+ ContextDir : tt .ContextDir ,
1275
1278
}
1276
1279
buildConfigSpec := getBuildConfigSpec (params )
1277
1280
@@ -1282,6 +1285,10 @@ func TestGetBuildConfigSpec(t *testing.T) {
1282
1285
if buildConfigSpec .Source .Git .Ref != tt .GitRef || buildConfigSpec .Source .Git .URI != tt .GitURL {
1283
1286
t .Error ("TestGetBuildConfigSpec error - build config git source does not match" )
1284
1287
}
1288
+
1289
+ if buildConfigSpec .CommonSpec .Source .ContextDir != tt .ContextDir {
1290
+ t .Error ("TestGetBuildConfigSpec error - context dir does not match" )
1291
+ }
1285
1292
})
1286
1293
}
1287
1294
You can’t perform that action at this time.
0 commit comments