Skip to content

Commit fd243e6

Browse files
committed
fix: PaC does not refer tekton hub
Signed-off-by: Matej Vašek <[email protected]>
1 parent 1743dbe commit fd243e6

File tree

3 files changed

+10
-25
lines changed

3 files changed

+10
-25
lines changed

pkg/pipelines/tekton/templates.go

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,6 @@ const (
2929
taskGitCloneRef = "git-clone"
3030

3131
// Following part holds a reference to Git Clone Task to be used in Pipeline template,
32-
// the usage depends whether we use direct code upload or Git reference for a standard (non PAC) on-cluster build
33-
taskGitClonePACTaskRef = `- name: fetch-sources
34-
params:
35-
- name: url
36-
value: $(params.gitRepository)
37-
- name: revision
38-
value: $(params.gitRevision)
39-
taskRef:
40-
kind: Task
41-
name: git-clone
42-
workspaces:
43-
- name: output
44-
workspace: source-workspace
45-
- name: cache
46-
workspace: cache-workspace
47-
- name: dockerconfig
48-
workspace: dockerconfig-workspace`
49-
5032
taskGitCloneTaskRef = `- name: fetch-sources
5133
params:
5234
- name: URL
@@ -114,13 +96,22 @@ type templateData struct {
11496
// createPipelineTemplatePAC creates a Pipeline template used for PAC on-cluster build
11597
// it creates the resource in the project directory
11698
func createPipelineTemplatePAC(f fn.Function, labels map[string]string) error {
99+
gct, err := getGitCloneTask()
100+
if err != nil {
101+
return fmt.Errorf("error getting git clone task: %v", err)
102+
}
103+
gts, err := getTaskSpec(gct)
104+
if err != nil {
105+
return err
106+
}
117107
data := templateData{
118108
FunctionName: f.Name,
119109
Annotations: f.Deploy.Annotations,
120110
Labels: labels,
121111
PipelineName: getPipelineName(f),
122112
RunAfterFetchSources: runAfterFetchSourcesRef,
123-
GitCloneTaskRef: taskGitClonePACTaskRef,
113+
GitCloneTaskRef: taskGitCloneTaskRef,
114+
GitCloneTaskSpec: gts,
124115
}
125116

126117
for _, val := range []struct {

pkg/pipelines/tekton/templates_pack.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ metadata:
173173
# The branch or tag we are targeting (ie: main, refs/tags/*)
174174
pipelinesascode.tekton.dev/on-target-branch: "[{{.PipelinesTargetBranch}}]"
175175
176-
# Fetch the git-clone task from hub
177-
pipelinesascode.tekton.dev/task: {{.GitCloneTaskRef}}
178-
179176
# How many runs we want to keep attached to this event
180177
pipelinesascode.tekton.dev/max-keep-runs: "5"
181178

pkg/pipelines/tekton/templates_s2i.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ metadata:
180180
# The branch or tag we are targeting (ie: main, refs/tags/*)
181181
pipelinesascode.tekton.dev/on-target-branch: "[{{.PipelinesTargetBranch}}]"
182182
183-
# Fetch the git-clone task from hub
184-
pipelinesascode.tekton.dev/task: {{.GitCloneTaskRef}}
185-
186183
# Fetch the pipelie definition from the .tekton directory
187184
pipelinesascode.tekton.dev/pipeline: {{.PipelineYamlURL}}
188185

0 commit comments

Comments
 (0)