Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A panic occurs when validating optional workspace during the execution of pipelinerun with CustomRun #8561

Open
l-qing opened this issue Feb 11, 2025 · 0 comments · May be fixed by #8562
Open
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@l-qing
Copy link
Member

l-qing commented Feb 11, 2025

Expected Behavior

PipelineRun can execute normally, and the controller does not panic.

Actual Behavior

The controller has panicked.

Steps to Reproduce the Problem

  1. Install Tekton Pipelines
kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.68.0/release.yaml
  1. (Optional) Install Pipelines-in-Pipelines component
# Ref: https://github.com/tektoncd/experimental/tree/main/pipelines-in-pipelines
kubectl apply --filename https://storage.googleapis.com/tekton-releases-nightly/pipelines-in-pipelines/latest/release.yaml
  1. run the pipelinerun
cat <<'EOF' | kubectl apply -f -
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: build-app
  namespace: default
spec:
  workspaces:
    - name: source
      optional: true
  params:
    - name: step
      type: string
  tasks:
    - name: step-1
      workspaces:
        - name: source
          workspace: source
      params:
        - name: step
          value: $(params.step)
      taskSpec:
        results:
          - name: outputValue
            description: the sum of the first and second operand
        workspaces:
          - name: source
            optional: true
        params:
          - name: step
            type: string
        steps:
          - name: echo
            image: ubuntu
            imagePullPolicy: IfNotPresent
            workingDir: $(workspaces.source.path)
            script: |
              $(params.step)

              echo -n "`date`: $(context.taskRun.name)" | tee $(results.outputValue.path)
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: build-apps
spec:
  workspaces:
    - name: source
      volumeClaimTemplate:
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
  pipelineSpec:
    workspaces:
      - name: source
        description: Workspace for shared code source
        optional: true      # <- This configuration will trigger a panic.
    tasks:
      - name: build-app-1
        taskRef:
          apiVersion: tekton.dev/v1beta1
          kind: Pipeline
          name: build-app
        params:
          - name: step
            value: |
              #!/usr/bin/env bash
              ls -artl
        workspaces:
          - name: source
            workspace: source
EOF

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: v1.32.1
Kustomize Version: v5.5.0
Server Version: v1.28.8
WARNING: version difference between client (1.32) and server (1.28) exceeds the supported minor version skew of +/-1
  • Tekton Pipeline version:

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

Client version: 0.39.1
Pipeline version: v0.68.0
@l-qing l-qing added the kind/bug Categorizes issue or PR as related to a bug. label Feb 11, 2025
l-qing added a commit to l-qing/pipeline that referenced this issue Feb 11, 2025
fix tektoncd#8561

When validating the optional workspace of the pipeline, encountering a CustomRun
should not cause a panic, as this configuration will be validated again during
the creation of the CustomRun.
l-qing added a commit to l-qing/pipeline that referenced this issue Feb 11, 2025
fix tektoncd#8561

When validating the optional workspace of the pipeline, encountering a CustomRun
should not cause a panic, as this configuration will be validated again during
the creation of the CustomRun.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

1 participant