@ -46,19 +46,19 @@ public class TaskHandler {
switch ( scanTask . getScanRequest ( ) . getType ( ) )
{
case BREW :
scanTask . setTektonRunId ( invokeScanTask ( scanTask . getScanRequest ( ) . brewBuild . buildRef ) ) ;
scanTask . setTektonRunId ( invokeScanTask ( scanTask . getScanRequest ( ) . brewBuild . buildRef , "" ) ) ;
scanTask . setState ( ScanTaskState . RUNNING ) ;
break ;
case PNC :
String repo = scanTask . getScanRequest ( ) . pncBuild . SCMURL ( ) . toString ( ) ;
String ref = scanTask . getScanRequest ( ) . pncBuild . revision ( ) ;
scanTask . setTektonRunId ( invokeOshScmScanPipeline ( repo , ref ) ) ;
scanTask . setTektonRunId ( invokeOshScmScanPipeline ( repo , ref , scanTask . getScanRequest ( ) . getScanProperties ( ) ) ) ;
scanTask . setState ( ScanTaskState . RUNNING ) ;
break ;
case GIT :
scanTask . setTektonRunId ( invokeOshScmScanPipeline ( scanTask . getScanRequest ( ) . git . repo . toString ( ) , scanTask . getScanRequest ( ) . git . ref ) ) ;
scanTask . setTektonRunId ( invokeOshScmScanPipeline ( scanTask . getScanRequest ( ) . git . repo . toString ( ) , scanTask . getScanRequest ( ) . git . ref , scanTask . getScanRequest ( ) . getScanProperties ( ) ) ) ;
scanTask . setState ( ScanTaskState . RUNNING ) ;
break ;
}
@ -66,7 +66,7 @@ public class TaskHandler {
return scanTask ;
}
public String invokeScanTask ( String buildId ) {
public String invokeScanTask ( String buildId , String mockbuildArgs ) {
// String buildId = "xterm-366-8.el9";
String scanProfile = "snyk-only-unstable" ;
@ -89,7 +89,7 @@ public class TaskHandler {
return taskRun . getMetadata ( ) . getName ( ) ;
}
public String invokeOshScmScanPipeline ( String repo , String ref ) {
public String invokeOshScmScanPipeline ( String repo , String ref , String mockBuildArgs ) {
PodSecurityContext securityContext = new PodSecurityContextBuilder ( )
. withRunAsNonRoot ( true )
@ -126,6 +126,7 @@ public class TaskHandler {
. withNewPipelineRef ( ) . withName ( PIPELINE_REFERENCE ) . endPipelineRef ( )
. addNewParam ( ) . withName ( "repo-url" ) . withNewValue ( repo ) . endParam ( )
. addNewParam ( ) . withName ( "revision" ) . withNewValue ( ref ) . endParam ( )
. addNewParam ( ) . withName ( "mock-build-params" ) . withNewValue ( mockBuildArgs ) . endParam ( )
. withWorkspaces ( workspaceBindings )
. endSpec ( )
. build ( ) ;