fix(cicd): bound branch follower drilldown visibility
This commit is contained in:
@@ -36,9 +36,15 @@ async function main() {
|
||||
if (resolution.taskRun === null) {
|
||||
console.log(JSON.stringify({
|
||||
ok: false,
|
||||
degradedReason: "taskrun-not-found",
|
||||
degradedReason: resolution.degradedReason || "taskrun-not-found",
|
||||
message: resolution.message || null,
|
||||
query: { namespace, taskRun: query, pipelineRun: pipelineRunName || null, pipelineRunPrefix: pipelineRunPrefix || null },
|
||||
candidates: resolution.candidates,
|
||||
resolution: {
|
||||
mode: resolution.mode,
|
||||
bounded: true,
|
||||
namespaceTaskRunList: false,
|
||||
},
|
||||
statusAuthority: useServiceAccount ? "kubernetes-api-serviceaccount" : "target-node-kubectl-raw",
|
||||
parsedDownstreamCliOutput: false,
|
||||
}));
|
||||
@@ -121,10 +127,21 @@ async function main() {
|
||||
async function resolveTaskRun() {
|
||||
const direct = await getJson(`/apis/tekton.dev/v1/namespaces/${encodeURIComponent(namespace)}/taskruns/${encodeURIComponent(query)}`, false);
|
||||
if (direct !== null) return { mode: "direct-name", taskRun: direct, candidates: [] };
|
||||
if (!pipelineRunName) {
|
||||
const fullNameMiss = pipelineRunPrefix.length > 0 && query.startsWith(`${pipelineRunPrefix}-`);
|
||||
return {
|
||||
mode: fullNameMiss ? "direct-name-not-found" : "pipeline-run-required",
|
||||
degradedReason: fullNameMiss ? "taskrun-not-found" : "pipeline-run-required",
|
||||
message: fullNameMiss
|
||||
? `TaskRun ${query} was not found in namespace ${namespace}`
|
||||
: "--pipeline-run is required for pipeline-task alias lookup; namespace-wide TaskRun listing is disabled",
|
||||
taskRun: null,
|
||||
candidates: [],
|
||||
};
|
||||
}
|
||||
const selectors = [];
|
||||
if (pipelineRunName) selectors.push(`tekton.dev/pipelineRun=${pipelineRunName},tekton.dev/pipelineTask=${query}`);
|
||||
selectors.push(`tekton.dev/pipelineTask=${query}`);
|
||||
selectors.push(`tekton.dev/task=${query}`);
|
||||
selectors.push(`tekton.dev/pipelineRun=${pipelineRunName},tekton.dev/pipelineTask=${query}`);
|
||||
selectors.push(`tekton.dev/pipelineRun=${pipelineRunName},tekton.dev/task=${query}`);
|
||||
for (const selector of selectors) {
|
||||
const list = await getJson(`/apis/tekton.dev/v1/namespaces/${encodeURIComponent(namespace)}/taskruns?labelSelector=${encodeURIComponent(selector)}`, false);
|
||||
const candidates = taskRunCandidates(list);
|
||||
|
||||
Reference in New Issue
Block a user