From 87c98a3ebe5084c58348d24adaf7f7eff4d1b454 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Wed, 18 Sep 2024 16:58:09 +0200 Subject: [PATCH] =?UTF-8?q?cmd/konflux:=20track=20upstream=20for=20update-?= =?UTF-8?q?sources=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … instead of the same repository... Signed-off-by: Vincent Demeester --- cmd/konflux/main.go | 3 +++ .../templates/github/workflows/update-sources-branches.yaml | 2 +- cmd/konflux/templates/github/workflows/update-sources.yaml | 2 +- config/konflux/tektoncd-pipeline.yaml | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/konflux/main.go b/cmd/konflux/main.go index debf325..2df603e 100644 --- a/cmd/konflux/main.go +++ b/cmd/konflux/main.go @@ -19,6 +19,7 @@ var templateFS embed.FS type Application struct { Name string Repository string + Upstream string Branch string Components []string } @@ -32,6 +33,7 @@ type Component struct { type Config struct { Repository string + Upstream string Components []string } @@ -52,6 +54,7 @@ func main() { app := Application{ Name: c.Repository, Repository: path.Join("openshift-pipelines", c.Repository), + Upstream: c.Upstream, Components: c.Components, Branch: "main", } diff --git a/cmd/konflux/templates/github/workflows/update-sources-branches.yaml b/cmd/konflux/templates/github/workflows/update-sources-branches.yaml index 2f51c55..d5b7449 100644 --- a/cmd/konflux/templates/github/workflows/update-sources-branches.yaml +++ b/cmd/konflux/templates/github/workflows/update-sources-branches.yaml @@ -36,7 +36,7 @@ jobs: - name: Clone {{.Repository}} uses: actions/checkout@v4 with: - repository: {{.Repository}} + repository: {{.Upstream}} revision: {{"${{matrix.branch}}"}} path: upstream diff --git a/cmd/konflux/templates/github/workflows/update-sources.yaml b/cmd/konflux/templates/github/workflows/update-sources.yaml index b13e721..096a7cd 100644 --- a/cmd/konflux/templates/github/workflows/update-sources.yaml +++ b/cmd/konflux/templates/github/workflows/update-sources.yaml @@ -20,7 +20,7 @@ jobs: - name: Clone {{.Repository}} uses: actions/checkout@v4 with: - repository: {{.Repository}} + repository: {{.Upstream}} path: upstream - name: Commit new changes diff --git a/config/konflux/tektoncd-pipeline.yaml b/config/konflux/tektoncd-pipeline.yaml index 166ac31..bdf0a75 100644 --- a/config/konflux/tektoncd-pipeline.yaml +++ b/config/konflux/tektoncd-pipeline.yaml @@ -1,4 +1,5 @@ repository: tektoncd-pipeline +upstream: tektoncd/pipeline components: - controller - entrypoint