From 92dc5fd553f36dfb43a1f1a447a51f48b2a1c505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Thu, 7 Aug 2025 14:15:26 +0200 Subject: [PATCH 1/4] fix: affinity/coschedule tekton issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workspace set must be identical for all the tasks. Having strict subset of workspaces clearly does not work. Signed-off-by: Matej Vašek --- hack/allocate.sh | 12 ------------ pkg/pipelines/tekton/tasks.go | 12 ++++++++++++ pkg/pipelines/tekton/templates_pack.go | 8 ++++++++ pkg/pipelines/tekton/templates_s2i.go | 8 ++++++++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/hack/allocate.sh b/hack/allocate.sh index c2dcae3ac1..54d13f0f7d 100755 --- a/hack/allocate.sh +++ b/hack/allocate.sh @@ -412,18 +412,6 @@ tekton() { $KUBECTL create clusterrolebinding "${namespace}:knative-serving-namespaced-admin" --clusterrole=knative-serving-namespaced-admin --serviceaccount="${namespace}:default" - # TEMPORARY WORKAROUND: Disable affinity assistant to prevent pod scheduling issues - # This is a workaround for issues where affinity assistant pod names don't match - # what's expected by task pods, causing them to fail scheduling. - # Related issues: - # - https://github.com/tektoncd/pipeline/issues/6740 - # - https://github.com/tektoncd/pipeline/issues/7503 - # TODO: Remove this workaround once the underlying Tekton issue is resolved - echo "${blue}- Disabling affinity assistant (temporary workaround)${reset}" - $KUBECTL patch configmap feature-flags -n tekton-pipelines \ - -p '{"data":{"disable-affinity-assistant":"true", "coschedule":"disabled"}}' \ - --type=merge - echo "${green}✅ Tekton${reset}" } diff --git a/pkg/pipelines/tekton/tasks.go b/pkg/pipelines/tekton/tasks.go index 4a9c584904..b21fe1cc4f 100644 --- a/pkg/pipelines/tekton/tasks.go +++ b/pkg/pipelines/tekton/tasks.go @@ -416,6 +416,12 @@ spec: workspaces: - name: source description: The workspace containing the function project + - name: cache + optional: true + - name: sslcertdir + optional: true + - name: dockerconfig + optional: true steps: - name: func-deploy image: "%s" @@ -443,6 +449,12 @@ spec: workspaces: - name: source description: The workspace containing the function project + - name: cache + optional: true + - name: sslcertdir + optional: true + - name: dockerconfig + optional: true steps: - name: func-scaffold image: %s diff --git a/pkg/pipelines/tekton/templates_pack.go b/pkg/pipelines/tekton/templates_pack.go index e9ab0e3953..f38c39d36f 100644 --- a/pkg/pipelines/tekton/templates_pack.go +++ b/pkg/pipelines/tekton/templates_pack.go @@ -49,6 +49,10 @@ spec: workspaces: - name: source workspace: source-workspace + - name: cache + workspace: cache-workspace + - name: dockerconfig + workspace: dockerconfig-workspace {{.RunAfterFetchSources}} {{.FuncScaffoldTaskRef}} - name: build @@ -86,6 +90,10 @@ spec: workspaces: - name: source workspace: source-workspace + - name: cache + workspace: cache-workspace + - name: dockerconfig + workspace: dockerconfig-workspace workspaces: - description: Directory where function source is located. name: source-workspace diff --git a/pkg/pipelines/tekton/templates_s2i.go b/pkg/pipelines/tekton/templates_s2i.go index 7315a382bb..2c4c53a6f0 100644 --- a/pkg/pipelines/tekton/templates_s2i.go +++ b/pkg/pipelines/tekton/templates_s2i.go @@ -53,6 +53,10 @@ spec: workspaces: - name: source workspace: source-workspace + - name: cache + workspace: cache-workspace + - name: dockerconfig + workspace: dockerconfig-workspace {{.RunAfterFetchSources}} {{.FuncScaffoldTaskRef}} - name: build @@ -92,6 +96,10 @@ spec: workspaces: - name: source workspace: source-workspace + - name: cache + workspace: cache-workspace + - name: dockerconfig + workspace: dockerconfig-workspace workspaces: - description: Directory where function source is located. name: source-workspace From eec37ed819f22a4b96450d021c7ce85db0159158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Thu, 7 Aug 2025 17:29:52 +0200 Subject: [PATCH 2/4] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej Vašek --- pkg/pipelines/tekton/templates.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/pipelines/tekton/templates.go b/pkg/pipelines/tekton/templates.go index 3d22cdeb4b..fa91066c0c 100644 --- a/pkg/pipelines/tekton/templates.go +++ b/pkg/pipelines/tekton/templates.go @@ -43,7 +43,11 @@ const ( name: git-clone workspaces: - name: output - workspace: source-workspace` + workspace: source-workspace + - name: cache + workspace: cache-workspace + - name: dockerconfig + workspace: dockerconfig-workspace` // TODO fix Tekton Hub reference taskGitCloneTaskRef = `- name: fetch-sources params: @@ -64,7 +68,11 @@ const ( value: "0.4" workspaces: - name: output - workspace: source-workspace` + workspace: source-workspace + - name: cache + workspace: cache-workspace + - name: dockerconfig + workspace: dockerconfig-workspace` runAfterFetchSourcesRef = `runAfter: - fetch-sources` From be429f2019d807d6c3b3448d3e9ea7e83b53a357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Mon, 11 Aug 2025 13:14:27 +0200 Subject: [PATCH 3/4] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej Vašek --- pkg/pipelines/tekton/templates.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/pipelines/tekton/templates.go b/pkg/pipelines/tekton/templates.go index fa91066c0c..48c9f797b2 100644 --- a/pkg/pipelines/tekton/templates.go +++ b/pkg/pipelines/tekton/templates.go @@ -68,11 +68,7 @@ const ( value: "0.4" workspaces: - name: output - workspace: source-workspace - - name: cache - workspace: cache-workspace - - name: dockerconfig - workspace: dockerconfig-workspace` + workspace: source-workspace` runAfterFetchSourcesRef = `runAfter: - fetch-sources` From 415cc3455cc077e834c6dc40be6f3c069ba81b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Thu, 21 Aug 2025 15:08:48 +0200 Subject: [PATCH 4/4] WIP TEST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej Vašek --- pkg/pipelines/tekton/templates.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/pipelines/tekton/templates.go b/pkg/pipelines/tekton/templates.go index 48c9f797b2..4352623cb5 100644 --- a/pkg/pipelines/tekton/templates.go +++ b/pkg/pipelines/tekton/templates.go @@ -46,8 +46,10 @@ const ( workspace: source-workspace - name: cache workspace: cache-workspace + optional: true - name: dockerconfig - workspace: dockerconfig-workspace` + workspace: dockerconfig-workspace + optional: true` // TODO fix Tekton Hub reference taskGitCloneTaskRef = `- name: fetch-sources params: @@ -58,17 +60,17 @@ const ( - name: gitInitImage value: ghcr.io/tektoncd/github.com/tektoncd/pipeline/cmd/git-init:v0.21.0 taskRef: - resolver: hub - params: - - name: kind - value: task - - name: name - value: git-clone - - name: version - value: "0.4" + kind: Task + name: git-clone workspaces: - name: output - workspace: source-workspace` + workspace: source-workspace + - name: cache + workspace: cache-workspace + optional: true + - name: dockerconfig + workspace: dockerconfig-workspace + optional: true` runAfterFetchSourcesRef = `runAfter: - fetch-sources`