@@ -19,6 +19,7 @@ import (
19
19
)
20
20
21
21
const (
22
+ PostBuildVolume = "post-build-volume"
22
23
WorkspaceSource = "source"
23
24
WorkspaceMount = "/var/workdir"
24
25
WorkspaceTls = "tls"
@@ -137,7 +138,7 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
137
138
verifyBuiltArtifactsArgs := verifyParameters (jbsConfig , recipe )
138
139
deployArgs := []string {
139
140
"verify" ,
140
- "--path=$(workspaces.source.path)/verify- artifacts" ,
141
+ "--path=$(workspaces.source.path)/artifacts" ,
141
142
"--logs-path=$(workspaces.source.path)/logs" ,
142
143
"--task-run-name=$(context.taskRun.name)" ,
143
144
"--build-id=" + buildId ,
@@ -533,8 +534,10 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
533
534
ps .Results = append (ps .Results , tektonpipeline.PipelineResult {Name : PipelineResultImageDigest , Value : tektonpipeline.ResultValue {Type : tektonpipeline .ParamTypeString , StringVal : "$(tasks." + BuildTaskName + ".results." + PipelineResultImageDigest + ")" }})
534
535
535
536
postBuildTask := tektonpipeline.TaskSpec {
536
- Workspaces : []tektonpipeline.WorkspaceDeclaration {{Name : WorkspaceSource , MountPath : WorkspaceMount }, {Name : WorkspaceTls }},
537
- Params : append (pipelineParams , tektonpipeline.ParamSpec {Name : PipelineResultPreBuildImageDigest , Type : tektonpipeline .ParamTypeString }),
537
+ // Using a default emptyDir volume as this task is unique to JBS and don't want it interfering with
538
+ // the shared workspace.
539
+ Volumes : []v1.Volume {{Name : PostBuildVolume , VolumeSource : v1.VolumeSource {EmptyDir : & v1.EmptyDirVolumeSource {}}}},
540
+ Params : append (pipelineParams , tektonpipeline.ParamSpec {Name : PipelineResultPreBuildImageDigest , Type : tektonpipeline .ParamTypeString }),
538
541
Results : []tektonpipeline.TaskResult {
539
542
{Name : PipelineResultContaminants },
540
543
{Name : PipelineResultDeployedResources },
@@ -544,6 +547,7 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
544
547
Steps : []tektonpipeline.Step {
545
548
{
546
549
Name : "restore-post-build-artifacts" ,
550
+ VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : WorkspaceMount }},
547
551
Image : strings .TrimSpace (strings .Split (buildTrustedArtifacts , "FROM" )[1 ]),
548
552
ImagePullPolicy : v1 .PullIfNotPresent ,
549
553
SecurityContext : & v1.SecurityContext {RunAsUser : & zero },
@@ -556,14 +560,15 @@ URL=%s
556
560
DIGEST=$(tasks.%s.results.IMAGE_DIGEST)
557
561
AARCHIVE=$(oras manifest fetch $ORAS_OPTIONS $URL@$DIGEST | jq --raw-output '.layers[0].digest')
558
562
echo "URL $URL DIGEST $DIGEST AARCHIVE $AARCHIVE"
559
- use-archive oci:$URL@$AARCHIVE=$(workspaces.source.path)/verify- artifacts` , orasOptions , registryArgsWithDefaults (jbsConfig , "" ), BuildTaskName ),
563
+ use-archive oci:$URL@$AARCHIVE=$(workspaces.source.path)/artifacts` , orasOptions , registryArgsWithDefaults (jbsConfig , "" ), BuildTaskName ),
560
564
},
561
565
{
562
566
Name : "verify-and-check-for-contaminates" ,
563
567
Image : buildRequestProcessorImage ,
564
568
ImagePullPolicy : pullPolicy ,
565
569
SecurityContext : & v1.SecurityContext {RunAsUser : & zero },
566
570
Env : secretVariables ,
571
+ VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : WorkspaceMount }},
567
572
ComputeResources : v1.ResourceRequirements {
568
573
Requests : v1.ResourceList {"memory" : limits .defaultBuildRequestMemory , "cpu" : limits .defaultRequestCPU },
569
574
Limits : v1.ResourceList {"memory" : limits .defaultBuildRequestMemory , "cpu" : limits .defaultLimitCPU },
0 commit comments