Skip to content

Overriding Pipeline timeout does not work #8114

Open
@MarijnJV

Description

Expected Behavior

A PipelineRun, created by a Pipeline should not timeout after 1 hour, but rather after 2h30m.

I used the following configuration:

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: pipeline-name
spec:
  tasks:
    - name: task-name
      taskRef:
        kind: Task
        name: task-name
      timeout: "2h30m0s"

Actual Behavior

A PipelineRun, created by a Pipeline runs out after 1 hour:

PipelineRun "pipeline-name-id" failed to finish within "1h0m0s"

The PipelineRun yaml configuration contains the following:

spec:
  pipelineRef:
    name: pipeline-name
  taskRunTemplate:
    serviceAccountName: pipeline
  timeouts:
    pipeline: 1h0m0s

The pipeline timeout is not overwritten and the pipeline fails.

Steps to Reproduce the Problem

  1. Create a Pipeline with a task that takes over an hour to complete.
  2. Set the timeout of the task to more than 1 hour (as shown in the "Expected Behavior" section).
  3. Run the Pipeline. Check the created PipelineRun config for the timeout limits

Additional Info

I am running a pipeline with 2 tasks, one of which takes longer than an hour. I have specified the timeout limit for this task. However, when a PipelineRun is created by the Pipeline, the default value of 1 hour is not overwritten. I have followed the documentation on how to set a timeout for a pipeline, which seems to have to be done on the task-level.

In the PipelineRun yaml, created by the Pipeline, both:

tasks:
      - name: task-name
        taskRef:
          kind: Task
          name: task-name
        timeout: 2h30m0s

and

spec:
  pipelineRef:
    name: pipeline-name
  taskRunTemplate:
    serviceAccountName: pipeline
  timeouts:
    pipeline: 1h0m0s

are present. Because the pipeline timeout is shorter than the task timeout, the pipeline will fail after an hour.

I have also tried to set the default timeout value to 2 hours via a ConfigMap. This did not work either:

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-defaults
  namespace: tekton-pipelines
data:
  default-timeout-minutes: "150"

This still resulted in a 1 hour timeout limit.

PipelineRun

Using the following configuration for a PipelineRun does work. In this case the default value of 1 hour is overwritten by 2h40m. However, I would like to not have to create my PipelineRuns manually.

apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
  name: trigger
spec:
  resourcetemplates:
    - apiVersion: tekton.dev/v1beta1
      kind: PipelineRun
      metadata:
        generateName: triggered
      spec:
        pipelineRef:
          name: pipeline-name
        timeout: "2h40m0s"

  • Kubernetes version: v1.27.10+28ed2d7 (OpenShift 4.4)

    Output of kubectl version:

Client Version: v1.27.4
Kustomize Version: v5.0.1
Server Version: v1.27.10+28ed2d7
  • Tekton Pipeline version: tekton.dev/v1beta1

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions