@@ -1130,6 +1130,7 @@ func TestDecorate(t *testing.T) {
1130
1130
gCSCredentialsSecret := "gcs-secret"
1131
1131
defaultServiceAccountName := "default-sa"
1132
1132
censor := true
1133
+ ignoreInterrupts := false
1133
1134
var testCases = []struct {
1134
1135
name string
1135
1136
spec * coreapi.PodSpec
@@ -1230,6 +1231,53 @@ func TestDecorate(t *testing.T) {
1230
1231
},
1231
1232
rawEnv : map [string ]string {"custom" : "env" },
1232
1233
},
1234
+ {
1235
+ name : "ignore interrupts in sidecar" ,
1236
+ spec : & coreapi.PodSpec {
1237
+ Volumes : []coreapi.Volume {
1238
+ {Name : "secret" , VolumeSource : coreapi.VolumeSource {Secret : & coreapi.SecretVolumeSource {SecretName : "secretname" }}},
1239
+ },
1240
+ Containers : []coreapi.Container {
1241
+ {Name : "test" , Command : []string {"/bin/ls" }, Args : []string {"-l" , "-a" }, VolumeMounts : []coreapi.VolumeMount {{Name : "secret" , MountPath : "/secret" }}},
1242
+ },
1243
+ ServiceAccountName : "tester" ,
1244
+ },
1245
+ pj : & prowapi.ProwJob {
1246
+ Spec : prowapi.ProwJobSpec {
1247
+ DecorationConfig : & prowapi.DecorationConfig {
1248
+ Timeout : & prowapi.Duration {Duration : time .Minute },
1249
+ GracePeriod : & prowapi.Duration {Duration : time .Hour },
1250
+ UtilityImages : & prowapi.UtilityImages {
1251
+ CloneRefs : "cloneimage" ,
1252
+ InitUpload : "initimage" ,
1253
+ Entrypoint : "entrypointimage" ,
1254
+ Sidecar : "sidecarimage" ,
1255
+ },
1256
+ Resources : & prowapi.Resources {
1257
+ CloneRefs : & coreapi.ResourceRequirements {Limits : coreapi.ResourceList {"cpu" : resource.Quantity {}}, Requests : coreapi.ResourceList {"memory" : resource.Quantity {}}},
1258
+ InitUpload : & coreapi.ResourceRequirements {Limits : coreapi.ResourceList {"cpu" : resource.Quantity {}}, Requests : coreapi.ResourceList {"memory" : resource.Quantity {}}},
1259
+ PlaceEntrypoint : & coreapi.ResourceRequirements {Limits : coreapi.ResourceList {"cpu" : resource.Quantity {}}, Requests : coreapi.ResourceList {"memory" : resource.Quantity {}}},
1260
+ Sidecar : & coreapi.ResourceRequirements {Limits : coreapi.ResourceList {"cpu" : resource.Quantity {}}, Requests : coreapi.ResourceList {"memory" : resource.Quantity {}}},
1261
+ },
1262
+ GCSConfiguration : & prowapi.GCSConfiguration {
1263
+ Bucket : "bucket" ,
1264
+ PathStrategy : "single" ,
1265
+ DefaultOrg : "org" ,
1266
+ DefaultRepo : "repo" ,
1267
+ },
1268
+ GCSCredentialsSecret : & gCSCredentialsSecret ,
1269
+ DefaultServiceAccountName : & defaultServiceAccountName ,
1270
+ IgnoreInterrupts : & ignoreInterrupts ,
1271
+ },
1272
+ Refs : & prowapi.Refs {
1273
+ Org : "org" , Repo : "repo" , BaseRef : "main" , BaseSHA : "abcd1234" ,
1274
+ Pulls : []prowapi.Pull {{Number : 1 , SHA : "aksdjhfkds" }},
1275
+ },
1276
+ ExtraRefs : []prowapi.Refs {{Org : "other" , Repo : "something" , BaseRef : "release" , BaseSHA : "sldijfsd" }},
1277
+ },
1278
+ },
1279
+ rawEnv : map [string ]string {"custom" : "env" },
1280
+ },
1233
1281
}
1234
1282
1235
1283
for _ , testCase := range testCases {
0 commit comments