Skip to content

Instantly share code, notes, and snippets.

@pt033302
Last active August 10, 2020 06:14
Show Gist options
  • Save pt033302/43403ba2b3a67be9c8bebbb5760e4744 to your computer and use it in GitHub Desktop.
Save pt033302/43403ba2b3a67be9c8bebbb5760e4744 to your computer and use it in GitHub Desktop.
name about
Issue Template
Template for bug reports

Expected Behavior

When I specify timeout to my workloads explictly, If my work load(task) is taking more time than provided timeout, it should fail

scenarios:

  1. Pipelineruntimeout.yaml
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: banana
spec:
  steps:
    - args:
        - '-c'
        - sleep 10
      command:
        - /bin/sh
      image: busybox
      name: ''
      resources: {}
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: tomatoes
spec:
  tasks:
    - name: foo
      taskRef:
        kind: Task
        name: banana
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: pear
spec:
  pipelineRef:
    name: tomatoes
  serviceAccountName: pipeline
  timeout: 5s
  1. pipelineTaskTimeout
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: success
spec:
  steps:
    - args:
        - 1s
      command:
        - sleep
      image: busybox
      name: ''
      resources: {}
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: timeout
spec:
  steps:
    - args:
        - 10s
      command:
        - sleep
      image: busybox
      name: ''
      resources: {}
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: pipelinetasktimeout
spec:
  tasks:
    - name: pipelinetask1
      taskRef:
        kind: Task
        name: success
      timeout: 1m0s
    - name: pipelinetask2
      taskRef:
        kind: Task
        name: timeout
      timeout: 5s
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: prtasktimeout
spec:
  pipelineRef:
    name: pipelinetasktimeout
  serviceAccountName: pipeline

Expected pipelinerun status should fail with reason PipelineRunTimeout

Actual Behavior

Actual behaviour pipelinerun status is Succeeded

Actual Results

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"tekton.dev/v1alpha1","kind":"Pipeline","metadata":{"annotations":{},"name":"tomatoes","namespace":"pthangad-prtimeout"},"spec":{"tasks":[{"name":"foo","taskRef":{"kind":"Task","name":"banana"}}]}}
  selfLink: /apis/tekton.dev/v1alpha1/namespaces/pthangad-prtimeout/pipelineruns/pear
  resourceVersion: '4067106'
  name: pear
  uid: bf447d24-1340-4392-b86b-c2796b34e0b3
  creationTimestamp: '2020-04-28T06:43:22Z'
  generation: 1
  namespace: pthangad-prtimeout
  labels:
    tekton.dev/pipeline: tomatoes
spec:
  pipelineRef:
    name: tomatoes
  serviceAccountName: pipeline
  timeout: 5s
status:
  completionTime: '2020-04-28T06:43:24Z'
  conditions:
    - lastTransitionTime: '2020-04-28T06:43:24Z'
      message: 'Tasks Completed: 1, Skipped: 0'
      reason: Succeeded
      status: 'True'
      type: Succeeded
  startTime: '2020-04-28T06:43:22Z'
  taskRuns:
    pear-foo-wv4wh:
      pipelineTaskName: foo
      status:
        completionTime: '2020-04-28T06:43:24Z'
        conditions:
          - lastTransitionTime: '2020-04-28T06:43:24Z'
            message: All Steps have completed executing
            reason: Succeeded
            status: 'True'
            type: Succeeded
        podName: pear-foo-wv4wh-pod-zqgc2
        startTime: '2020-04-28T06:43:22Z'
        steps:
          - container: step-unnamed-0
            imageID: >-
              docker.io/library/busybox@sha256:a2490cec4484ee6c1068ba3a05f89934010c85242f736280b35343483b2264b6
            name: unnamed-0
            terminated:
              containerID: >-
                cri-o://dc2640d4a38e00ad0d16d5d2bc382a285035c779c662b1d70cfebca87aad1748
              exitCode: 0
              finishedAt: '2020-04-28T06:43:24Z'
              reason: Completed
              startedAt: '2020-04-28T06:43:14Z'
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  creationTimestamp: '2020-04-28T06:55:19Z'
  generation: 1
  labels:
    tekton.dev/pipeline: pipelinetasktimeout
  name: prtasktimeout
  namespace: pthangad-prtimeout
  resourceVersion: '4073101'
  selfLink: >-
    /apis/tekton.dev/v1alpha1/namespaces/pthangad-prtimeout/pipelineruns/prtasktimeout
  uid: 0d4a4e13-cbe0-42d3-8573-367c47402f8a
spec:
  pipelineRef:
    name: pipelinetasktimeout
  serviceAccountName: pipeline
  timeout: 1h0m0s
status:
  completionTime: '2020-04-28T06:56:08Z'
  conditions:
    - lastTransitionTime: '2020-04-28T06:56:08Z'
      message: 'Tasks Completed: 2, Skipped: 0'
      reason: Succeeded
      status: 'True'
      type: Succeeded
  startTime: '2020-04-28T06:55:50Z'
  taskRuns:
    prtasktimeout-pipelinetask1-pkl4c:
      pipelineTaskName: pipelinetask1
      status:
        completionTime: '2020-04-28T06:56:00Z'
        conditions:
          - lastTransitionTime: '2020-04-28T06:56:00Z'
            message: All Steps have completed executing
            reason: Succeeded
            status: 'True'
            type: Succeeded
        podName: prtasktimeout-pipelinetask1-pkl4c-pod-k8p4z
        startTime: '2020-04-28T06:56:06Z'
        steps:
          - container: step-unnamed-0
            imageID: >-
              docker.io/library/busybox@sha256:a2490cec4484ee6c1068ba3a05f89934010c85242f736280b35343483b2264b6
            name: unnamed-0
            terminated:
              containerID: >-
                cri-o://81fbf5e5f035373bdc1fb909b96af9a99579599b87bdc629ccc8b14bc7c72a9b
              exitCode: 0
              finishedAt: '2020-04-28T06:55:27Z'
              reason: Completed
              startedAt: '2020-04-28T06:55:26Z'
    prtasktimeout-pipelinetask2-hzr96:
      pipelineTaskName: pipelinetask2
      status:
        completionTime: '2020-04-28T06:56:08Z'
        conditions:
          - lastTransitionTime: '2020-04-28T06:56:08Z'
            message: All Steps have completed executing
            reason: Succeeded
            status: 'True'
            type: Succeeded
        podName: prtasktimeout-pipelinetask2-hzr96-pod-hnqsd
        startTime: '2020-04-28T06:56:07Z'
        steps:
          - container: step-unnamed-0
            imageID: >-
              docker.io/library/busybox@sha256:a2490cec4484ee6c1068ba3a05f89934010c85242f736280b35343483b2264b6
            name: unnamed-0
            terminated:
              containerID: >-
                cri-o://2345d67c0563a534d975cf37c36cd7750f091207fa40193fe99d2947a8038fa5
              exitCode: 0
              finishedAt: '2020-04-28T06:55:35Z'
              reason: Completed
              startedAt: '2020-04-28T06:55:25Z'

Steps to Reproduce the Problem

  1. oc apply -f https://gist.githubusercontent.com/praveen4g0/c937f74a209a436a55c8f4c64e042853/raw/6aa7d7d364c63ffcc19438e60a7aa6d818c65a7f/pipelineruntimeout.yaml
  2. oc apply -f https://gist.githubusercontent.com/praveen4g0/0592fe9b31257d37e759131e33656ade/raw/1579030ab6be341463a1a280272f5082cffc0844/pipelinetaskruntimeout.yaml

Additional Info

  • Tekton Pipeline version:

    Output of oc get pods -n openshift-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

    v0.14.3
    
  • Triggers Version: Output of oc get pods -n openshift-pipelines -l app=tekton-triggers-controller -o=jsonpath='{.items[0].metadata.labels.version}'

    v0.6.2
    
  • cli version: Output of tkn version

Client version: dev
Pipeline version: v0.14.3
Triggers version: v0.6.1
  • Openshift cluster version: Output of oc version
Client Version: 4.5.0-202005291417-9933eb9
Server Version: 4.5.4
Kubernetes Version: v1.18.3+012b3ec
  • Operator version:
    Eg: CSV 1.1.0-rc2
    

Jira-info

  • Affects Version/s:
    Pipelines 1.1
    
  • Components
    Pipeline
    

NOTE

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