Skip to content

Commit a572f7a

Browse files
committed
Remove workspace from prebuildgit
1 parent bfc2f8b commit a572f7a

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

deploy/tasks/pre-build-git.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ spec:
1313
description: |-
1414
Sets up pre-build for pushing the source.
1515
params:
16+
- name: PRE_BUILD_IMAGE_DIGEST
17+
description: Digest to use
18+
type: string
1619
- name: NAME
1720
description: Name of the pipeline run (i.e. unique dependency build name)
1821
type: string
@@ -41,16 +44,25 @@ spec:
4144
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
4245
description: Name of the processor image. Useful to override for development.
4346
type: string
44-
default: "quay.io/ncross/hacbs-jvm-build-request-processor:latest"
45-
# default: "quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/jvm-build-service/build-request-processor:latest"
4647
results:
4748
- name: GIT_ARCHIVE
4849
description: Git archive information
49-
workspaces:
50-
- description: The git repo will be cloned onto the volume backing this Workspace.
51-
name: source
52-
mountPath: /var/workdir
50+
volumes:
51+
- name: workdir
52+
emptyDir: {}
53+
stepTemplate:
54+
volumeMounts:
55+
- mountPath: /var/workdir
56+
name: workdir
5357
steps:
58+
- name: restore-trusted-artifact
59+
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:52f1391e6f1c472fd10bb838f64fae2ed3320c636f536014978a5ddbdfc6b3af
60+
script: |
61+
echo "Restoring source to workspace"
62+
use-archive $PRE_BUILD_IMAGE_DIGEST=/var/workdir/
63+
env:
64+
- name: PRE_BUILD_IMAGE_DIGEST
65+
value: $(params.PRE_BUILD_IMAGE_DIGEST)
5466
- name: create-pre-build-source
5567
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
5668
securityContext:

pkg/reconciler/dependencybuild/buildrecipeyaml.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,6 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
441441
// Can't specify name and resolver as they clash.
442442
ResolverRef: preBuildGitResolver,
443443
},
444-
Workspaces: []tektonpipeline.WorkspacePipelineTaskBinding{
445-
{Name: WorkspaceSource, Workspace: WorkspaceSource},
446-
},
447444
Params: []tektonpipeline.Param{
448445
{
449446
Name: "NAME",
@@ -452,6 +449,13 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
452449
StringVal: imageId,
453450
},
454451
},
452+
{
453+
Name: "PRE_BUILD_IMAGE_DIGEST",
454+
Value: tektonpipeline.ParamValue{
455+
Type: tektonpipeline.ParamTypeString,
456+
StringVal: "$(tasks." + PreBuildTaskName + ".results." + PipelineResultPreBuildImageDigest + ")",
457+
},
458+
},
455459
{
456460
Name: "GIT_IDENTITY",
457461
Value: tektonpipeline.ParamValue{
@@ -503,6 +507,7 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
503507
},
504508
},
505509
}}
510+
fmt.Printf("### prebuildgit %#v \n", pipelinePreBuildGitTask)
506511
ps.Tasks = append(pipelineGitTask, ps.Tasks...)
507512
ps.Tasks = append(pipelinePreBuildTask, ps.Tasks...)
508513
ps.Tasks = append(pipelinePreBuildGitTask, ps.Tasks...)
@@ -801,6 +806,7 @@ use-archive oci:$URL@$AARCHIVE=%s`, orasOptions, registryArgsWithDefaults(jbsCon
801806
ps.Tasks[index].Params = append(ps.Tasks[index].Params, tektonpipeline.Param{
802807
Name: i.Name,
803808
Value: value})
809+
fmt.Printf("### index %s and params %#v \n ", ps.Tasks[index].Params)
804810
index += 1
805811
ps.Tasks[index].Params = append(ps.Tasks[index].Params, tektonpipeline.Param{
806812
Name: i.Name,

pkg/reconciler/dependencybuild/dependencybuild.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ func (r *ReconcileDependencyBuild) handleStateBuilding(ctx context.Context, db *
668668
log.Info(fmt.Sprintf("handleStateBuilding: pipelinerun %s:%s already exists, not retrying", pr.Namespace, pr.Name))
669669
return reconcile.Result{}, nil
670670
}
671-
r.eventRecorder.Eventf(db, v1.EventTypeWarning, "PipelineRunCreationFailed", "The DependencyBuild %s/%s failed to create its build pipeline run", db.Namespace, db.Name)
671+
r.eventRecorder.Eventf(db, v1.EventTypeWarning, "PipelineRunCreationFailed", "The DependencyBuild %s/%s failed to create its build pipeline run with %#v", db.Namespace, db.Name, err)
672672
return reconcile.Result{}, err
673673
}
674674
return reconcile.Result{}, r.client.Status().Update(ctx, db)

0 commit comments

Comments
 (0)