【问题标题】:How to write a tekton result api example call如何编写 tekton 结果 api 示例调用
【发布时间】:2022-11-09 23:42:02
【问题描述】:

我想从 tektoncd result api 查询任务运行的结果,但我很难将查询放在一起。你能帮我吗?

我已经完成了https://github.com/tektoncd/results/blob/main/docs/install.md 的步骤

不确定 curl 调用会是什么样子。

【问题讨论】:

    标签: tekton


    【解决方案1】:

    Tekton 相关对象的示例 API 调用查询:

    curl -k --header 'Authorization: Bearer xxx' 
      https://api-k8s.xxx.com:6443/apis/tekton.dev/v1beta1/namespaces/YOUR_NAMESPACE_HERE/pipelineruns | jq '.[]'
    curl -k --header 'Authorization: Bearer xxx' 
      https://api-k8s.xxx.com:6443/apis/tekton.dev/v1beta1/namespaces/YOUR_NAMESPACE_HERE/taskruns/YOUR_RESOURCE_NAME_HERE | jq '.[]'
    

    知道任务运行名称后,我们可以使用以下命令查询其结果:

    curl -s -k --header 'Authorization: Bearer xxx' 
       https://api-k8s.xxx.com:6443/apis/tekton.dev/v1beta1/namespaces/ci/taskruns/scalelite-recording-importer-1.3.4-1-build 
       | jq .status.taskResults
    [
      {
        "name": "IMAGE_DIGEST",
        "type": "string",
        "value": "sha256:14e52d648f6e99e4b339272658b2a7d57f81f145b0f3f178a0deccb65300a75c"
      }
    ]
    

    【讨论】:

      猜你喜欢
      • 2019-05-26
      • 1970-01-01
      • 2015-12-14
      • 2018-02-21
      • 2019-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多