Skip to content

Commit 7185d86

Browse files
committed
fix
Signed-off-by: Robert Cerven <rcerven@redhat.com>
1 parent 3afba72 commit 7185d86

File tree

3 files changed

+1310
-675
lines changed

3 files changed

+1310
-675
lines changed

internal/controller/component_build_controller_pipeline.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,12 @@ func generatePaCPipelineRunForComponent(
527527
}
528528
}
529529

530-
pipelineRunWorkspaces := createWorkspaceBinding(pipelineSpec.Workspaces)
530+
var pipelineRunWorkspaces []tektonapi.WorkspaceBinding
531+
if pipelineSpec != nil {
532+
pipelineRunWorkspaces = createWorkspaceBinding(pipelineSpec.Workspaces)
533+
} else {
534+
pipelineRunWorkspaces = generateWorkspaceBinding()
535+
}
531536

532537
pipelineRun := &tektonapi.PipelineRun{
533538
TypeMeta: metav1.TypeMeta{
@@ -722,6 +727,19 @@ func createWorkspaceBinding(pipelineWorkspaces []tektonapi.PipelineWorkspaceDecl
722727
return pipelineRunWorkspaces
723728
}
724729

730+
func generateWorkspaceBinding() []tektonapi.WorkspaceBinding {
731+
return []tektonapi.WorkspaceBinding{
732+
{
733+
Name: "workspace",
734+
VolumeClaimTemplate: generateVolumeClaimTemplate(),
735+
},
736+
{
737+
Name: "git-auth",
738+
Secret: &corev1.SecretVolumeSource{SecretName: "{{ git_auth_secret }}"},
739+
},
740+
}
741+
}
742+
725743
func generateVolumeClaimTemplate() *corev1.PersistentVolumeClaim {
726744
return &corev1.PersistentVolumeClaim{
727745
Spec: corev1.PersistentVolumeClaimSpec{

0 commit comments

Comments
 (0)