fix: degrade agentrun status json probe
This commit is contained in:
@@ -915,7 +915,7 @@ function statusScript(pipelineRun: string | null): string {
|
||||
pr.length > 0
|
||||
? [
|
||||
`if kubectl -n ${ciNamespace} get pipelinerun ${shQuote(pr)} -o json >/tmp/agentrun-v01-pipelinerun.json 2>/dev/null; then`,
|
||||
"node <<'NODE'",
|
||||
"node <<'NODE' || printf '{}\\n'",
|
||||
"const fs = require('node:fs');",
|
||||
"const pr = JSON.parse(fs.readFileSync('/tmp/agentrun-v01-pipelinerun.json', 'utf8'));",
|
||||
"const condition = pr?.status?.conditions?.[0] || {};",
|
||||
@@ -945,7 +945,7 @@ function statusScript(pipelineRun: string | null): string {
|
||||
pr.length > 0
|
||||
? [
|
||||
`if kubectl -n ${ciNamespace} get taskrun -l tekton.dev/pipelineRun=${shQuote(pr)} -o json >/tmp/agentrun-v01-taskruns.json 2>/dev/null; then`,
|
||||
"node <<'NODE'",
|
||||
"node <<'NODE' || printf '{}\\n'",
|
||||
"const fs = require('node:fs');",
|
||||
"const data = JSON.parse(fs.readFileSync('/tmp/agentrun-v01-taskruns.json', 'utf8'));",
|
||||
"const items = Array.isArray(data.items) ? data.items : [];",
|
||||
|
||||
Reference in New Issue
Block a user