File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,10 +72,23 @@ jobs:
7272 run : |
7373 mkdir -p /tmp/k8s-artifacts
7474 kubectl logs -n func-operator-system -l control-plane=controller-manager --tail=-1 --all-containers --prefix --timestamps > /tmp/k8s-artifacts/func-operator.log || true
75- for resource in functions deployments configmaps; do
75+ for resource in functions deployments configmaps pipelineruns ; do
7676 kubectl get ${resource} -A -o yaml > /tmp/k8s-artifacts/${resource}.yaml || true
7777 done
7878
79+ # Install Tekton CLI for better PipelineRun log collection
80+ curl -LO https://github.com/tektoncd/cli/releases/download/v0.44.1/tkn_0.44.1_Linux_x86_64.tar.gz
81+ tar xvzf tkn_0.44.1_Linux_x86_64.tar.gz -C /tmp
82+ chmod +x /tmp/tkn
83+
84+ # Collect logs from all pipelineruns using Tekton CLI
85+ /tmp/tkn pipelinerun list -A > /tmp/k8s-artifacts/pipelinerun-list.txt 2>&1 || true
86+ for pr in $(kubectl get pipelineruns -A -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{"\n"}{end}'); do
87+ ns=$(echo $pr | awk '{print $1}')
88+ name=$(echo $pr | awk '{print $2}')
89+ /tmp/tkn pipelinerun logs $name -n $ns > /tmp/k8s-artifacts/pipelinerun-logs-${ns}-${name}.log 2>&1 || true
90+ done
91+
7992 - name : Upload Kubernetes artifacts
8093 if : failure()
8194 uses : actions/upload-artifact@v7
You can’t perform that action at this time.
0 commit comments