Skip to content

bug: pipeline fails silently with invalid taskRef.apiVersion instead of providing a error #9044

@waveywaves

Description

@waveywaves

Expected Behavior

When a Pipeline's .spec.tasks[*].taskRef.apiVersion field is configured with an invalid value; Tekton should immediately reject the Pipeline creation with a clear validation error message. The error should indicate that the apiVersion value is invalid and explain the expected format (e.g., "group/version" for custom tasks, or empty for regular Tekton tasks).

Actual Behavior

Pipelines with invalid taskRef.apiVersion values are created successfully without any validation errors. When a PipelineRun is created for such a Pipeline, it starts execution and creates a CustomRun with the invalid apiVersion. Since no controller can handle the invalid apiVersion, the CustomRun remains stuck indefinitely. The PipelineRun eventually fails after timeout with a generic message like "PipelineRun failed to finish within X minutes", not indicate that the root cause was an invalid apiVersion. This makes it very difficult to diagnose the actual problem.

Steps to Reproduce the Problem

 1. Create a simple Task:
  apiVersion: tekton.dev/v1
  kind: Task
  metadata:
    name: test-task
  spec:
    steps:
    - name: echo
      image: busybox
      command: [echo]
      args: ["Hello World"]

  2. Create a Pipeline with invalid apiVersion in taskRef:
  apiVersion: tekton.dev/v1
  kind: Pipeline
  metadata:
    name: test-invalid-apiversion
  spec:
    tasks:
    - name: my-task
      taskRef:
        name: test-task
        apiVersion: "invalid-api-version"  # Invalid format
        kind: Task

  3. Create a PipelineRun:
  apiVersion: tekton.dev/v1
  kind: PipelineRun
  metadata:
    name: test-invalid-apiversion-run
  spec:
    pipelineRef:
      name: test-invalid-apiversion
    timeouts:
      pipeline: 2m

Additional Info

  • Kubernetes version:

    **Output of kubectl version:v1.29.2 (kind cluster)

(paste your output here)
  • Tekton Pipeline version: built from main branch

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

tkn version 
Client version: 0.41.1
Pipeline version: devel
(paste your output here)

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions