Konflux Archived PipelineRuns by openshift/hypershift
npx skills add https://github.com/openshift/hypershift --skill 'Konflux Archived PipelineRuns'此技能提供了访问由 kube archiver 归档的 Konflux PipelineRun 的工作流程。PipelineRun 在完成后会迅速被归档,通常无法通过 oc get 命令获取。请使用 KubeArchive REST API 来检索 PipelineRun 详情、TaskRun 结果和 Pod 日志。
此技能在以下情况下会自动应用:
oc get 找不到 PipelineRun 时crt-redhat-acm-tenantapi.stone-prd-rh01.pg1f.p1.openshiftapps.com:6443oc get 命令获取广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
归档的 PipelineRun、TaskRun、Pod 和 Pod 日志可通过 KubeArchive REST API 访问:
KA_HOST="https://kubearchive-api-server-product-kubearchive.apps.stone-prd-rh01.pg1f.p1.openshiftapps.com"
身份验证使用 oc 令牌:
curl -s -H "Authorization: Bearer $(oc whoami -t)" "${KA_HOST}/livez"
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/apis/tekton.dev/v1/namespaces/crt-redhat-acm-tenant/pipelineruns/<PIPELINERUN_NAME>"
子 TaskRun 的引用位于 status.childReferences 中:
data['status']['childReferences'] # list of {name, kind, apiVersion, pipelineTaskName}
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/apis/tekton.dev/v1/namespaces/crt-redhat-acm-tenant/taskruns/<TASKRUN_NAME>"
TaskRun 结果位于 status.results 中。
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/api/v1/namespaces/crt-redhat-acm-tenant/pods?labelSelector=tekton.dev/taskRun=<TASKRUN_NAME>"
首先从 Pod 规格(spec.initContainers 和 spec.containers)中列出可用的容器,然后获取日志:
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/api/v1/namespaces/crt-redhat-acm-tenant/pods/<POD_NAME>/log?container=<CONTAINER_NAME>"
HEAD_SHA=$(gh pr view <PR> --repo openshift/hypershift --json headRefOid -q .headRefOid)
# 查找失败的 EC 检查运行
gh api repos/openshift/hypershift/commits/${HEAD_SHA}/check-runs --paginate \
--jq '.check_runs[] | select(.name | test("enterprise-contract")) | select(.conclusion == "failure") | {name: .name, id: .id}'
# 从检查输出中获取 PipelineRun 名称
gh api repos/openshift/hypershift/commits/${HEAD_SHA}/check-runs --paginate \
--jq '.check_runs[] | select(.name | test("enterprise-contract")) | select(.conclusion == "failure") | .output.text'
PipelineRun 名称会出现在输出文本的 <a href="..."> 标签中。
EC 验证任务 Pod 包含以下具有有用输出的容器:
step-report-json - 包含所有违规的结构化 JSON(推荐)step-summary - 人类可读的摘要step-detailed-report - 详细报告{
"success": false,
"components": [{
"name": "component-name",
"containerImage": "quay.io/...",
"violations": [{
"msg": "Human-readable message",
"metadata": {
"code": "rule.code.name",
"title": "Rule title",
"description": "Rule description",
"solution": "How to fix"
}
}]
}]
}
按 metadata.code 对违规进行分组,并提供包含计数、规则名称和个别消息的摘要。
tasks.required_untrusted_task_found存在必需的任务,但该任务未从受信任的版本解析。通过更新 .tekton/ 流水线文件中的任务引用来修复。
trusted_task.trusted任务版本不在受信任的任务列表中。违规消息包含需要升级到的 SHA。通过更新 .tekton/ 流水线文件中的任务摘要来修复。
oc whoami -t 失败: 用户必须使用 oc login 登录到 Konflux 集群/livez 失败: 检查 oc 是否已登录到正确的集群(api.stone-prd-rh01.pg1f.p1.openshiftapps.com:6443)crt-redhat-acm-tenant 中尝试 oc get每周安装次数
–
代码仓库
GitHub 星标数
515
首次出现时间
–
安全审计
This skill provides the workflow for accessing Konflux PipelineRuns that have been archived by the kube archiver. PipelineRuns are archived quickly after completion and are typically NOT available via oc get. Use the KubeArchive REST API to retrieve PipelineRun details, TaskRun results, and pod logs.
This skill automatically applies when:
oc get in the Konflux namespacecrt-redhat-acm-tenantapi.stone-prd-rh01.pg1f.p1.openshiftapps.com:6443oc getArchived PipelineRuns, TaskRuns, pods, and pod logs are accessible through the KubeArchive REST API:
KA_HOST="https://kubearchive-api-server-product-kubearchive.apps.stone-prd-rh01.pg1f.p1.openshiftapps.com"
Authentication uses the oc token:
curl -s -H "Authorization: Bearer $(oc whoami -t)" "${KA_HOST}/livez"
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/apis/tekton.dev/v1/namespaces/crt-redhat-acm-tenant/pipelineruns/<PIPELINERUN_NAME>"
Child TaskRun references are in status.childReferences:
data['status']['childReferences'] # list of {name, kind, apiVersion, pipelineTaskName}
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/apis/tekton.dev/v1/namespaces/crt-redhat-acm-tenant/taskruns/<TASKRUN_NAME>"
TaskRun results are in status.results.
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/api/v1/namespaces/crt-redhat-acm-tenant/pods?labelSelector=tekton.dev/taskRun=<TASKRUN_NAME>"
List available containers first from the pod spec (spec.initContainers and spec.containers), then fetch logs:
curl -s -H "Authorization: Bearer $(oc whoami -t)" \
"${KA_HOST}/api/v1/namespaces/crt-redhat-acm-tenant/pods/<POD_NAME>/log?container=<CONTAINER_NAME>"
HEAD_SHA=$(gh pr view <PR> --repo openshift/hypershift --json headRefOid -q .headRefOid)
# Find failing EC check runs
gh api repos/openshift/hypershift/commits/${HEAD_SHA}/check-runs --paginate \
--jq '.check_runs[] | select(.name | test("enterprise-contract")) | select(.conclusion == "failure") | {name: .name, id: .id}'
# Get PipelineRun names from check output
gh api repos/openshift/hypershift/commits/${HEAD_SHA}/check-runs --paginate \
--jq '.check_runs[] | select(.name | test("enterprise-contract")) | select(.conclusion == "failure") | .output.text'
The PipelineRun name appears in an <a href="..."> tag in the output text.
The EC verify task pod has these containers with useful output:
step-report-json - Structured JSON with all violations (preferred)step-summary - Human-readable summarystep-detailed-report - Detailed report{
"success": false,
"components": [{
"name": "component-name",
"containerImage": "quay.io/...",
"violations": [{
"msg": "Human-readable message",
"metadata": {
"code": "rule.code.name",
"title": "Rule title",
"description": "Rule description",
"solution": "How to fix"
}
}]
}]
}
Group violations by metadata.code and present a summary with counts, rule names, and individual messages.
tasks.required_untrusted_task_foundA required task is present but not resolved from a trusted version. Fix by updating the task reference in .tekton/ pipeline files.
trusted_task.trustedA task version is not in the trusted task list. The violation message includes the required SHA to upgrade to. Fix by updating task digests in .tekton/ pipeline files.
oc whoami -t fails: User must log in to the Konflux cluster with oc login/livez fails: Check that oc is logged in to the correct cluster (api.stone-prd-rh01.pg1f.p1.openshiftapps.com:6443)oc get directly in namespace crt-redhat-acm-tenantWeekly Installs
–
Repository
GitHub Stars
515
First Seen
–
Security Audits
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
107,900 周安装