@ -87,6 +87,8 @@ public class BuildRequest {
private final String applicationDirectory ;
private final List < String > securityOptions ;
BuildRequest ( ImageReference name , Function < Owner , TarArchive > applicationContent ) {
Assert . notNull ( name , "Name must not be null" ) ;
Assert . notNull ( applicationContent , "ApplicationContent must not be null" ) ;
@ -109,13 +111,14 @@ public class BuildRequest {
this . launchCache = null ;
this . createdDate = null ;
this . applicationDirectory = null ;
this . securityOptions = null ;
}
BuildRequest ( ImageReference name , Function < Owner , TarArchive > applicationContent , ImageReference builder ,
ImageReference runImage , Creator creator , Map < String , String > env , boolean cleanCache ,
boolean verboseLogging , PullPolicy pullPolicy , boolean publish , List < BuildpackReference > buildpacks ,
List < Binding > bindings , String network , List < ImageReference > tags , Cache buildWorkspace , Cache buildCache ,
Cache launchCache , Instant createdDate , String applicationDirectory ) {
Cache launchCache , Instant createdDate , String applicationDirectory , List < String > securityOptions ) {
this . name = name ;
this . applicationContent = applicationContent ;
this . builder = builder ;
@ -135,6 +138,7 @@ public class BuildRequest {
this . launchCache = launchCache ;
this . createdDate = createdDate ;
this . applicationDirectory = applicationDirectory ;
this . securityOptions = securityOptions ;
}
/ * *
@ -147,7 +151,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , builder . inTaggedOrDigestForm ( ) , this . runImage ,
this . creator , this . env , this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish ,
this . buildpacks , this . bindings , this . network , this . tags , this . buildWorkspace , this . buildCache ,
this . launchCache , this . createdDate , this . applicationDirectory );
this . launchCache , this . createdDate , this . applicationDirectory , this . securityOptions );
}
/ * *
@ -159,7 +163,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , runImageName . inTaggedOrDigestForm ( ) ,
this . creator , this . env , this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish ,
this . buildpacks , this . bindings , this . network , this . tags , this . buildWorkspace , this . buildCache ,
this . launchCache , this . createdDate , this . applicationDirectory );
this . launchCache , this . createdDate , this . applicationDirectory , this . securityOptions );
}
/ * *
@ -172,7 +176,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -189,7 +193,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator ,
Collections . unmodifiableMap ( env ) , this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish ,
this . buildpacks , this . bindings , this . network , this . tags , this . buildWorkspace , this . buildCache ,
this . launchCache , this . createdDate , this . applicationDirectory );
this . launchCache , this . createdDate , this . applicationDirectory , this . securityOptions );
}
/ * *
@ -204,7 +208,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator ,
Collections . unmodifiableMap ( updatedEnv ) , this . cleanCache , this . verboseLogging , this . pullPolicy ,
this . publish , this . buildpacks , this . bindings , this . network , this . tags , this . buildWorkspace ,
this . buildCache , this . launchCache , this . createdDate , this . applicationDirectory );
this . buildCache , this . launchCache , this . createdDate , this . applicationDirectory , this . securityOptions );
}
/ * *
@ -216,7 +220,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -228,7 +232,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -240,7 +244,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -252,7 +256,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -277,7 +281,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -302,7 +306,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -315,7 +319,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -338,7 +342,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -351,7 +355,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -364,7 +368,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -377,7 +381,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , launchCache , this . createdDate ,
this . applicationDirectory );
this . applicationDirectory , this . securityOptions );
}
/ * *
@ -390,7 +394,7 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache ,
parseCreatedDate ( createdDate ) , this . applicationDirectory );
parseCreatedDate ( createdDate ) , this . applicationDirectory , this . securityOptions );
}
private Instant parseCreatedDate ( String createdDate ) {
@ -415,7 +419,20 @@ public class BuildRequest {
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
applicationDirectory ) ;
applicationDirectory , this . securityOptions ) ;
}
/ * *
* Return a new { @link BuildRequest } with an updated security options .
* @param securityOptions the security options
* @return an updated build request
* /
public BuildRequest withSecurityOptions ( List < String > securityOptions ) {
Assert . notNull ( securityOptions , "SecurityOption must not be null" ) ;
return new BuildRequest ( this . name , this . applicationContent , this . builder , this . runImage , this . creator , this . env ,
this . cleanCache , this . verboseLogging , this . pullPolicy , this . publish , this . buildpacks , this . bindings ,
this . network , this . tags , this . buildWorkspace , this . buildCache , this . launchCache , this . createdDate ,
this . applicationDirectory , securityOptions ) ;
}
/ * *
@ -571,6 +588,14 @@ public class BuildRequest {
return this . applicationDirectory ;
}
/ * *
* Return the security options that should be used by the lifecycle .
* @return the security options
* /
public List < String > getSecurityOptions ( ) {
return this . securityOptions ;
}
/ * *
* Factory method to create a new { @link BuildRequest } from a JAR file .
* @param jarFile the source jar file