@@ -87,6 +87,8 @@ public class BuildRequest {
87
87
88
88
private final String applicationDirectory ;
89
89
90
+ private final List <String > securityOptions ;
91
+
90
92
BuildRequest (ImageReference name , Function <Owner , TarArchive > applicationContent ) {
91
93
Assert .notNull (name , "Name must not be null" );
92
94
Assert .notNull (applicationContent , "ApplicationContent must not be null" );
@@ -109,13 +111,14 @@ public class BuildRequest {
109
111
this .launchCache = null ;
110
112
this .createdDate = null ;
111
113
this .applicationDirectory = null ;
114
+ this .securityOptions = null ;
112
115
}
113
116
114
117
BuildRequest (ImageReference name , Function <Owner , TarArchive > applicationContent , ImageReference builder ,
115
118
ImageReference runImage , Creator creator , Map <String , String > env , boolean cleanCache ,
116
119
boolean verboseLogging , PullPolicy pullPolicy , boolean publish , List <BuildpackReference > buildpacks ,
117
120
List <Binding > bindings , String network , List <ImageReference > tags , Cache buildWorkspace , Cache buildCache ,
118
- Cache launchCache , Instant createdDate , String applicationDirectory ) {
121
+ Cache launchCache , Instant createdDate , String applicationDirectory , List < String > securityOptions ) {
119
122
this .name = name ;
120
123
this .applicationContent = applicationContent ;
121
124
this .builder = builder ;
@@ -135,6 +138,7 @@ public class BuildRequest {
135
138
this .launchCache = launchCache ;
136
139
this .createdDate = createdDate ;
137
140
this .applicationDirectory = applicationDirectory ;
141
+ this .securityOptions = securityOptions ;
138
142
}
139
143
140
144
/**
@@ -147,7 +151,7 @@ public BuildRequest withBuilder(ImageReference builder) {
147
151
return new BuildRequest (this .name , this .applicationContent , builder .inTaggedOrDigestForm (), this .runImage ,
148
152
this .creator , this .env , this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish ,
149
153
this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace , this .buildCache ,
150
- this .launchCache , this .createdDate , this .applicationDirectory );
154
+ this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
151
155
}
152
156
153
157
/**
@@ -159,7 +163,7 @@ public BuildRequest withRunImage(ImageReference runImageName) {
159
163
return new BuildRequest (this .name , this .applicationContent , this .builder , runImageName .inTaggedOrDigestForm (),
160
164
this .creator , this .env , this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish ,
161
165
this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace , this .buildCache ,
162
- this .launchCache , this .createdDate , this .applicationDirectory );
166
+ this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
163
167
}
164
168
165
169
/**
@@ -172,7 +176,7 @@ public BuildRequest withCreator(Creator creator) {
172
176
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , creator , this .env ,
173
177
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
174
178
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
175
- this .applicationDirectory );
179
+ this .applicationDirectory , this . securityOptions );
176
180
}
177
181
178
182
/**
@@ -189,7 +193,7 @@ public BuildRequest withEnv(String name, String value) {
189
193
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator ,
190
194
Collections .unmodifiableMap (env ), this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish ,
191
195
this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace , this .buildCache ,
192
- this .launchCache , this .createdDate , this .applicationDirectory );
196
+ this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
193
197
}
194
198
195
199
/**
@@ -204,7 +208,7 @@ public BuildRequest withEnv(Map<String, String> env) {
204
208
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator ,
205
209
Collections .unmodifiableMap (updatedEnv ), this .cleanCache , this .verboseLogging , this .pullPolicy ,
206
210
this .publish , this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace ,
207
- this .buildCache , this .launchCache , this .createdDate , this .applicationDirectory );
211
+ this .buildCache , this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
208
212
}
209
213
210
214
/**
@@ -216,7 +220,7 @@ public BuildRequest withCleanCache(boolean cleanCache) {
216
220
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
217
221
cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
218
222
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
219
- this .applicationDirectory );
223
+ this .applicationDirectory , this . securityOptions );
220
224
}
221
225
222
226
/**
@@ -228,7 +232,7 @@ public BuildRequest withVerboseLogging(boolean verboseLogging) {
228
232
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
229
233
this .cleanCache , verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
230
234
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
231
- this .applicationDirectory );
235
+ this .applicationDirectory , this . securityOptions );
232
236
}
233
237
234
238
/**
@@ -240,7 +244,7 @@ public BuildRequest withPullPolicy(PullPolicy pullPolicy) {
240
244
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
241
245
this .cleanCache , this .verboseLogging , pullPolicy , this .publish , this .buildpacks , this .bindings ,
242
246
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
243
- this .applicationDirectory );
247
+ this .applicationDirectory , this . securityOptions );
244
248
}
245
249
246
250
/**
@@ -252,7 +256,7 @@ public BuildRequest withPublish(boolean publish) {
252
256
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
253
257
this .cleanCache , this .verboseLogging , this .pullPolicy , publish , this .buildpacks , this .bindings ,
254
258
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
255
- this .applicationDirectory );
259
+ this .applicationDirectory , this . securityOptions );
256
260
}
257
261
258
262
/**
@@ -277,7 +281,7 @@ public BuildRequest withBuildpacks(List<BuildpackReference> buildpacks) {
277
281
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
278
282
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , buildpacks , this .bindings ,
279
283
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
280
- this .applicationDirectory );
284
+ this .applicationDirectory , this . securityOptions );
281
285
}
282
286
283
287
/**
@@ -302,7 +306,7 @@ public BuildRequest withBindings(List<Binding> bindings) {
302
306
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
303
307
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , bindings ,
304
308
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
305
- this .applicationDirectory );
309
+ this .applicationDirectory , this . securityOptions );
306
310
}
307
311
308
312
/**
@@ -315,7 +319,7 @@ public BuildRequest withNetwork(String network) {
315
319
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
316
320
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
317
321
network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
318
- this .applicationDirectory );
322
+ this .applicationDirectory , this . securityOptions );
319
323
}
320
324
321
325
/**
@@ -338,7 +342,7 @@ public BuildRequest withTags(List<ImageReference> tags) {
338
342
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
339
343
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
340
344
this .network , tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
341
- this .applicationDirectory );
345
+ this .applicationDirectory , this . securityOptions );
342
346
}
343
347
344
348
/**
@@ -351,7 +355,7 @@ public BuildRequest withBuildWorkspace(Cache buildWorkspace) {
351
355
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
352
356
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
353
357
this .network , this .tags , buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
354
- this .applicationDirectory );
358
+ this .applicationDirectory , this . securityOptions );
355
359
}
356
360
357
361
/**
@@ -364,7 +368,7 @@ public BuildRequest withBuildCache(Cache buildCache) {
364
368
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
365
369
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
366
370
this .network , this .tags , this .buildWorkspace , buildCache , this .launchCache , this .createdDate ,
367
- this .applicationDirectory );
371
+ this .applicationDirectory , this . securityOptions );
368
372
}
369
373
370
374
/**
@@ -377,7 +381,7 @@ public BuildRequest withLaunchCache(Cache launchCache) {
377
381
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
378
382
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
379
383
this .network , this .tags , this .buildWorkspace , this .buildCache , launchCache , this .createdDate ,
380
- this .applicationDirectory );
384
+ this .applicationDirectory , this . securityOptions );
381
385
}
382
386
383
387
/**
@@ -390,7 +394,7 @@ public BuildRequest withCreatedDate(String createdDate) {
390
394
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
391
395
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
392
396
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache ,
393
- parseCreatedDate (createdDate ), this .applicationDirectory );
397
+ parseCreatedDate (createdDate ), this .applicationDirectory , this . securityOptions );
394
398
}
395
399
396
400
private Instant parseCreatedDate (String createdDate ) {
@@ -415,7 +419,20 @@ public BuildRequest withApplicationDirectory(String applicationDirectory) {
415
419
return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
416
420
this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
417
421
this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
418
- applicationDirectory );
422
+ applicationDirectory , this .securityOptions );
423
+ }
424
+
425
+ /**
426
+ * Return a new {@link BuildRequest} with an updated security options.
427
+ * @param securityOptions the security options
428
+ * @return an updated build request
429
+ */
430
+ public BuildRequest withSecurityOptions (List <String > securityOptions ) {
431
+ Assert .notNull (securityOptions , "SecurityOption must not be null" );
432
+ return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
433
+ this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
434
+ this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
435
+ this .applicationDirectory , securityOptions );
419
436
}
420
437
421
438
/**
@@ -571,6 +588,14 @@ public String getApplicationDirectory() {
571
588
return this .applicationDirectory ;
572
589
}
573
590
591
+ /**
592
+ * Return the security options that should be used by the lifecycle.
593
+ * @return the security options
594
+ */
595
+ public List <String > getSecurityOptions () {
596
+ return this .securityOptions ;
597
+ }
598
+
574
599
/**
575
600
* Factory method to create a new {@link BuildRequest} from a JAR file.
576
601
* @param jarFile the source jar file
0 commit comments