Skip to content

Instantly share code, notes, and snippets.

@pritidesai
Created August 21, 2020 21:58
Show Gist options
  • Save pritidesai/4dc876ee528d110ebc0c2c2622cc9538 to your computer and use it in GitHub Desktop.
Save pritidesai/4dc876ee528d110ebc0c2c2622cc9538 to your computer and use it in GitHub Desktop.
kubectl get tr -o json
{
"apiVersion": "v1",
"items": [
{
"apiVersion": "tekton.dev/v1beta1",
"kind": "TaskRun",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"tekton.dev/v1beta1\",\"kind\":\"PipelineRun\",\"metadata\":{\"annotations\":{},\"name\":\"pipelinerun-with-timeout\",\"namespace\":\"default\"},\"spec\":{\"pipelineSpec\":{\"tasks\":[{\"name\":\"echo-good-morning\",\"taskSpec\":{\"steps\":[{\"image\":\"ubuntu\",\"name\":\"echo\",\"script\":\"#!/usr/bin/env bash\\necho \\\"Good Morning!\\\"\\nsleep 60\\n\"}]},\"timeout\":\"0h0m30s\"}]},\"timeout\":\"0h0m3s\"}}\n",
"pipeline.tekton.dev/release": "devel"
},
"creationTimestamp": "2020-08-21T21:50:00Z",
"generation": 1,
"labels": {
"app.kubernetes.io/managed-by": "tekton-pipelines",
"tekton.dev/pipeline": "pipelinerun-with-timeout",
"tekton.dev/pipelineRun": "pipelinerun-with-timeout",
"tekton.dev/pipelineTask": "echo-good-morning"
},
"name": "pipelinerun-with-timeout-echo-good-morning-sjjs7",
"namespace": "default",
"ownerReferences": [
{
"apiVersion": "tekton.dev/v1beta1",
"blockOwnerDeletion": true,
"controller": true,
"kind": "PipelineRun",
"name": "pipelinerun-with-timeout",
"uid": "386bb05e-5ef5-4414-81c7-04f0185aad05"
}
],
"resourceVersion": "1827130",
"selfLink": "/apis/tekton.dev/v1beta1/namespaces/default/taskruns/pipelinerun-with-timeout-echo-good-morning-sjjs7",
"uid": "f832f494-faa6-4704-b170-679a2d588059"
},
"spec": {
"resources": {},
"serviceAccountName": "",
"taskSpec": {
"steps": [
{
"image": "ubuntu",
"name": "echo",
"resources": {},
"script": "#!/usr/bin/env bash\necho \"Good Morning!\"\nsleep 60\n"
}
]
},
"timeout": "30s"
},
"status": {
"completionTime": "2020-08-21T21:50:30Z",
"conditions": [
{
"lastTransitionTime": "2020-08-21T21:50:30Z",
"message": "TaskRun \"pipelinerun-with-timeout-echo-good-morning-sjjs7\" failed to finish within \"30s\"",
"reason": "TaskRunTimeout",
"status": "False",
"type": "Succeeded"
}
],
"podName": "pipelinerun-with-timeout-echo-good-morning-sjjs7-pod-m2lk4",
"startTime": "2020-08-21T21:50:00Z",
"steps": [
{
"container": "step-echo",
"imageID": "docker-pullable://ubuntu@sha256:31dfb10d52ce76c5ca0aa19d10b3e6424b830729e32a89a7c6eee2cda2be67a5",
"name": "echo",
"terminated": {
"exitCode": 1,
"finishedAt": "2020-08-21T21:50:30Z",
"reason": "TaskRunTimeout",
"startedAt": "2020-08-21T21:50:12Z"
}
}
],
"taskSpec": {
"steps": [
{
"image": "ubuntu",
"name": "echo",
"resources": {},
"script": "#!/usr/bin/env bash\necho \"Good Morning!\"\nsleep 60\n"
}
]
}
}
}
],
"kind": "List",
"metadata": {
"resourceVersion": "",
"selfLink": ""
}
}
@pritidesai
Copy link
Author

pritidesai commented Aug 21, 2020

 tkn pr list
NAME                       STARTED         DURATION    STATUS
pipelinerun-with-timeout   5 seconds ago   3 seconds   Failed(PipelineRunTimeout)

 [67] -> tkn pr describe pipelinerun-with-timeout
Name:        pipelinerun-with-timeout
Namespace:   default
Timeout:     3s
Labels:
 tekton.dev/pipeline=pipelinerun-with-timeout

🌑️  Status

STARTED          DURATION    STATUS
14 seconds ago   3 seconds   Failed(PipelineRunTimeout)

πŸ’Œ Message

PipelineRun "pipelinerun-with-timeout" failed to finish within "3s"

πŸ“¦ Resources

 No resources

βš“ Params

 No params

πŸ—‚  Taskruns

 NAME                                                 TASK NAME           STARTED          DURATION   STATUS
 βˆ™ pipelinerun-with-timeout-echo-good-morning-758nt   echo-good-morning   14 seconds ago   ---        Running

 [68] -> tkn tr describe pipelinerun-with-timeout-echo-good-morning-758nt
Name:        pipelinerun-with-timeout-echo-good-morning-758nt
Namespace:   default
Timeout:     30s
Labels:
 app.kubernetes.io/managed-by=tekton-pipelines
 tekton.dev/pipeline=pipelinerun-with-timeout
 tekton.dev/pipelineRun=pipelinerun-with-timeout
 tekton.dev/pipelineTask=echo-good-morning

🌑️  Status

STARTED          DURATION    STATUS
26 seconds ago   ---         Running

πŸ“¨ Input Resources

 No input resources

πŸ“‘ Output Resources

 No output resources

βš“ Params

 No params

🦢 Steps

 NAME     STATUS
 βˆ™ echo   Running

πŸš— Sidecars

No sidecars

@pritidesai
Copy link
Author

kubectl get pr -o json
{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "tekton.dev/v1beta1",
            "kind": "PipelineRun",
            "metadata": {
                "annotations": {
                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"tekton.dev/v1beta1\",\"kind\":\"PipelineRun\",\"metadata\":{\"annotations\":{},\"name\":\"pipelinerun-with-timeout\",\"namespace\":\"default\"},\"spec\":{\"pipelineSpec\":{\"tasks\":[{\"name\":\"echo-good-morning\",\"taskSpec\":{\"steps\":[{\"image\":\"ubuntu\",\"name\":\"echo\",\"script\":\"#!/usr/bin/env bash\\necho \\\"Good Morning!\\\"\\nsleep 60\\n\"}]},\"timeout\":\"0h0m30s\"}]},\"timeout\":\"0h0m3s\"}}\n"
                },
                "creationTimestamp": "2020-08-21T23:34:50Z",
                "generation": 1,
                "labels": {
                    "tekton.dev/pipeline": "pipelinerun-with-timeout"
                },
                "name": "pipelinerun-with-timeout",
                "namespace": "default",
                "resourceVersion": "1838584",
                "selfLink": "/apis/tekton.dev/v1beta1/namespaces/default/pipelineruns/pipelinerun-with-timeout",
                "uid": "cdee569c-ef42-47a5-aa53-3ff7a961b73b"
            },
            "spec": {
                "pipelineSpec": {
                    "tasks": [
                        {
                            "name": "echo-good-morning",
                            "taskSpec": {
                                "steps": [
                                    {
                                        "image": "ubuntu",
                                        "name": "echo",
                                        "resources": {},
                                        "script": "#!/usr/bin/env bash\necho \"Good Morning!\"\nsleep 60\n"
                                    }
                                ]
                            },
                            "timeout": "30s"
                        }
                    ]
                },
                "timeout": "3s"
            },
            "status": {
                "completionTime": "2020-08-21T23:34:53Z",
                "conditions": [
                    {
                        "lastTransitionTime": "2020-08-21T23:34:53Z",
                        "message": "PipelineRun \"pipelinerun-with-timeout\" failed to finish within \"3s\"",
                        "reason": "PipelineRunTimeout",
                        "status": "False",
                        "type": "Succeeded"
                    }
                ],
                "pipelineSpec": {
                    "tasks": [
                        {
                            "name": "echo-good-morning",
                            "taskSpec": {
                                "steps": [
                                    {
                                        "image": "ubuntu",
                                        "name": "echo",
                                        "resources": {},
                                        "script": "#!/usr/bin/env bash\necho \"Good Morning!\"\nsleep 60\n"
                                    }
                                ]
                            },
                            "timeout": "30s"
                        }
                    ]
                },
                "startTime": "2020-08-21T23:34:50Z",
                "taskRuns": {
                    "pipelinerun-with-timeout-echo-good-morning-758nt": {
                        "pipelineTaskName": "echo-good-morning",
                        "status": {
                            "completionTime": "2020-08-21T23:35:20Z",
                            "conditions": [
                                {
                                    "lastTransitionTime": "2020-08-21T23:35:20Z",
                                    "message": "TaskRun \"pipelinerun-with-timeout-echo-good-morning-758nt\" failed to finish within \"30s\"",
                                    "reason": "TaskRunTimeout",
                                    "status": "False",
                                    "type": "Succeeded"
                                }
                            ],
                            "podName": "pipelinerun-with-timeout-echo-good-morning-758nt-pod-gbhvb",
                            "startTime": "2020-08-21T23:34:50Z",
                            "steps": [
                                {
                                    "container": "step-echo",
                                    "imageID": "docker-pullable://ubuntu@sha256:31dfb10d52ce76c5ca0aa19d10b3e6424b830729e32a89a7c6eee2cda2be67a5",
                                    "name": "echo",
                                    "terminated": {
                                        "exitCode": 1,
                                        "finishedAt": "2020-08-21T23:35:20Z",
                                        "reason": "TaskRunTimeout",
                                        "startedAt": "2020-08-21T23:34:58Z"
                                    }
                                }
                            ],
                            "taskSpec": {
                                "steps": [
                                    {
                                        "image": "ubuntu",
                                        "name": "echo",
                                        "resources": {},
                                        "script": "#!/usr/bin/env bash\necho \"Good Morning!\"\nsleep 60\n"
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment