From 819ea346b98ad17f2ca4111b3db8a5bac485dfb4 Mon Sep 17 00:00:00 2001 From: Admin Bot Date: Mon, 14 Sep 2026 07:43:35 +0900 Subject: [PATCH] refactor: use TaskRun directly, drop Pipeline wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pipeline was a pass-through wrapping one Task — unnecessary indirection. CI now creates TaskRun directly against the integration-test Task. --- .gitea/workflows/ci.yaml | 23 ++++++++--------- k8s/tekton/ci-rbac.yaml | 5 +--- k8s/tekton/kustomization.yaml | 1 - k8s/tekton/pipeline-integration-test.yaml | 30 ----------------------- 4 files changed, 13 insertions(+), 46 deletions(-) delete mode 100644 k8s/tekton/pipeline-integration-test.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 26db2f1..4b75071 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -72,30 +72,30 @@ jobs: RUN_NAME="integration-test-${SHA}" # Clean up any previous run with the same name - kubectl delete pipelinerun "${RUN_NAME}" -n api --ignore-not-found + kubectl delete taskrun "${RUN_NAME}" -n api --ignore-not-found - # Create PipelineRun — spins up gateway sidecar + curl tests + # Create TaskRun — spins up gateway sidecar + curl tests cat </dev/null; then echo "result=pass" >> $GITHUB_OUTPUT else @@ -105,12 +105,13 @@ jobs: # Print logs + results echo "" echo "=== Test Logs ===" - kubectl logs -n api "pipelinerun/${RUN_NAME}" --all-containers 2>/dev/null || true + POD=$(kubectl get pod -n api -l tekton.dev/taskRun=${RUN_NAME} -o name | head -1) + kubectl logs -n api "${POD}" -c step-run-tests 2>/dev/null || true echo "" - REASON=$(kubectl get pipelinerun "${RUN_NAME}" -n api \ + REASON=$(kubectl get taskrun "${RUN_NAME}" -n api \ -o jsonpath='{.status.conditions[0].reason}') - SUMMARY=$(kubectl get pipelinerun "${RUN_NAME}" -n api \ - -o jsonpath='{.status.results[?(@.name=="test-summary")].value}') + SUMMARY=$(kubectl get taskrun "${RUN_NAME}" -n api \ + -o jsonpath='{.status.results[?(@.name=="summary")].value}') echo "Status: ${REASON}" echo "Summary: ${SUMMARY}" diff --git a/k8s/tekton/ci-rbac.yaml b/k8s/tekton/ci-rbac.yaml index 81ca0de..5d51f03 100644 --- a/k8s/tekton/ci-rbac.yaml +++ b/k8s/tekton/ci-rbac.yaml @@ -15,12 +15,9 @@ metadata: name: ci-tekton-trigger namespace: api rules: -- apiGroups: ["tekton.dev"] - resources: ["pipelineruns"] - verbs: ["create", "get", "list", "watch", "delete"] - apiGroups: ["tekton.dev"] resources: ["taskruns"] - verbs: ["get", "list"] + verbs: ["create", "get", "list", "watch", "delete"] - apiGroups: [""] resources: ["pods", "pods/log"] verbs: ["get", "list"] diff --git a/k8s/tekton/kustomization.yaml b/k8s/tekton/kustomization.yaml index 917e24c..3bc75bb 100644 --- a/k8s/tekton/kustomization.yaml +++ b/k8s/tekton/kustomization.yaml @@ -6,7 +6,6 @@ namespace: api resources: - ci-rbac.yaml - task-integration-test.yaml -- pipeline-integration-test.yaml generatorOptions: disableNameSuffixHash: true diff --git a/k8s/tekton/pipeline-integration-test.yaml b/k8s/tekton/pipeline-integration-test.yaml deleted file mode 100644 index 6ad284e..0000000 --- a/k8s/tekton/pipeline-integration-test.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: Pipeline -metadata: - name: integration-test-pipeline - namespace: api - labels: - app: api-gateway - component: testing -spec: - description: > - Run integration tests against a gateway image. - Spins up the image as a sidecar, tests via curl, reports pass/fail. - params: - - name: image - type: string - description: "Container image to test (repo:sha)" - results: - - name: test-result - description: "pass or fail" - value: $(tasks.integration-test.results.result) - - name: test-summary - description: "e.g. 8/8 passed" - value: $(tasks.integration-test.results.summary) - tasks: - - name: integration-test - taskRef: - name: integration-test - params: - - name: image - value: $(params.image)