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

Taskrun not working with volumeClaimTemplate #5537

Closed
piyush-garg opened this issue Sep 22, 2022 · 1 comment · Fixed by #5559
Closed

Taskrun not working with volumeClaimTemplate #5537

piyush-garg opened this issue Sep 22, 2022 · 1 comment · Fixed by #5559
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.

Comments

@piyush-garg
Copy link
Contributor

Expected Behavior

Taskrun Should Work

Actual Behavior

Taskrun is throwing an error

task task-with-workspace has failed: failed to create task run pod "task-with-workspace-run-j622l": Pod "task-with-workspace-run-j622l-pod" is invalid: [spec.volumes[10].name: Required value, spec.containers[0].volumeMounts[0].name: Required value, spec.containers[0].volumeMounts[0].name: Not found: ""]. Maybe missing or invalid Task tekton-pipelines/task-with-workspace
Error: pod for taskrun task-with-workspace-run-j622l not available yet

Steps to Reproduce the Problem

  1. Create a task
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: task-with-workspace
spec:
  steps:
  - name: list-files
    image: ubuntu
    script: ls $(workspaces.read-allowed.path)
  workspaces:
  - name: read-allowed
  1. Create taskrun
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  generateName: task-with-workspace-run-
spec:
  taskRef:
    kind: Task
    name: task-with-workspace
  workspaces:
    - name: read-allowed
      volumeClaimTemplate:
        metadata:
          name: pvc
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
          volumeMode: Filesystem
  1. See the taskrun getting failed.

Additional Info

  • Kubernetes version:
  kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.1", GitCommit:"e4d4e1ab7cf1bf15273ef97303551b279f0920a9", GitTreeState:"clean", BuildDate:"2022-09-14T19:49:27Z", GoVersion:"go1.19.1", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0+3882f8f", GitCommit:"0a57f1f59bda75ea2cf13d9f3b4ac5d202134f2d", GitTreeState:"clean", BuildDate:"2022-09-13T15:03:52Z", GoVersion:"go1.18.4", Compiler:"gc", Platform:"linux/amd64"}
  • Tekton Pipeline version:
Client version: 0.26.0
Pipeline version: v0.40.0

It is working fine with pipeline 0.39 but not with pipeline 0.40. It is a regression.

@piyush-garg piyush-garg added the kind/bug Categorizes issue or PR as related to a bug. label Sep 22, 2022
@piyush-garg piyush-garg changed the title Taskrun not workng with volumeClaimTemplate Taskrun not working with volumeClaimTemplate Sep 22, 2022
@vdemeester
Copy link
Member

Will have to be included in a 0.40.1 👼🏼
/assign @piyush-garg
/assign @vdemeester

@dibyom dibyom added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 22, 2022
piyush-garg added a commit to piyush-garg/pipeline that referenced this issue Sep 26, 2022
…creation

This will move the auto name generation of workspace to happend after
the pvc is created for volumeClaimTemplate and then name will be generated for
workspace of volumeClaimTemplate type

Added an example

Fix tektoncd#5537
piyush-garg added a commit to piyush-garg/pipeline that referenced this issue Sep 26, 2022
This will move the auto name generation of workspace to happen after
the pvc is created for volumeClaimTemplate and then name will be generated for
workspace of volumeClaimTemplate type

Added an example

Fix tektoncd#5537
tekton-robot pushed a commit that referenced this issue Sep 26, 2022
This will move the auto name generation of workspace to happen after
the pvc is created for volumeClaimTemplate and then name will be generated for
workspace of volumeClaimTemplate type

Added an example

Fix #5537
tekton-robot pushed a commit to tekton-robot/pipeline that referenced this issue Sep 26, 2022
This will move the auto name generation of workspace to happen after
the pvc is created for volumeClaimTemplate and then name will be generated for
workspace of volumeClaimTemplate type

Added an example

Fix tektoncd#5537
tekton-robot pushed a commit that referenced this issue Sep 26, 2022
This will move the auto name generation of workspace to happen after
the pvc is created for volumeClaimTemplate and then name will be generated for
workspace of volumeClaimTemplate type

Added an example

Fix #5537
abayer added a commit to abayer/tektoncd-pipeline that referenced this issue Sep 28, 2022
fixes tektoncd#5574

With tektoncd#5537, the call to `applyParamsContextsResultsAndWorkspaces` and setting of `tr.Status.TaskSpec` to the output of that call was moved from happening with every call to `reconcile` to only happening if there wasn't already a pod created. This didn't cause any problems with execution, but it sometimes resulted in `tr.Status.TaskSpec` not getting set properly or getting reset to `nil` on a subsequent `reconcile` run, with the end result that, sometimes, `tr.Status.TaskSpec` would contain the original `TaskSpec` without parameter, result, context, and workspace references being replaced with the corresponding value. This caused flaky failures in the `TestPipelineRunStatusSpec/pipeline_status_spec_updated` e2e test, and integration test failures in Chains (tektoncd/chains#577).

This change moves the PVC creation out of the `if pod == nil {` block that creates the pod if needed, while still checking if `pod` is `nil` before creating the PVC, and brings the `applyParamsContextsResultsAndWorkspaces` call and setting of `tr.Status.TaskSpec` back out of the pod creation block, but after the possible PVC creation.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
abayer added a commit to abayer/tektoncd-pipeline that referenced this issue Sep 28, 2022
fixes tektoncd#5574

With tektoncd#5537, the call to `applyParamsContextsResultsAndWorkspaces` and setting of `tr.Status.TaskSpec` to the output of that call was moved from happening with every call to `reconcile` to only happening if there wasn't already a pod created. This didn't cause any problems with execution, but it sometimes resulted in `tr.Status.TaskSpec` not getting set properly or getting reset to `nil` on a subsequent `reconcile` run, with the end result that, sometimes, `tr.Status.TaskSpec` would contain the original `TaskSpec` without parameter, result, context, and workspace references being replaced with the corresponding value. This caused flaky failures in the `TestPipelineRunStatusSpec/pipeline_status_spec_updated` e2e test, and integration test failures in Chains (tektoncd/chains#577).

This change moves the PVC creation out of the `if pod == nil {` block that creates the pod if needed, while still checking if `pod` is `nil` before creating the PVC, and brings the `applyParamsContextsResultsAndWorkspaces` call and setting of `tr.Status.TaskSpec` back out of the pod creation block, but after the possible PVC creation.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
abayer added a commit to abayer/tektoncd-pipeline that referenced this issue Sep 29, 2022
fixes tektoncd#5574

With tektoncd#5537, the call to `applyParamsContextsResultsAndWorkspaces` and setting of `tr.Status.TaskSpec` to the output of that call was moved from happening with every call to `reconcile` to only happening if there wasn't already a pod created. This didn't cause any problems with execution, but it sometimes resulted in `tr.Status.TaskSpec` not getting set properly or getting reset to `nil` on a subsequent `reconcile` run, with the end result that, sometimes, `tr.Status.TaskSpec` would contain the original `TaskSpec` without parameter, result, context, and workspace references being replaced with the corresponding value. This caused flaky failures in the `TestPipelineRunStatusSpec/pipeline_status_spec_updated` e2e test, and integration test failures in Chains (tektoncd/chains#577).

This change moves the PVC creation out of the `if pod == nil {` block that creates the pod if needed, while still checking if `pod` is `nil` before creating the PVC, and brings the `applyParamsContextsResultsAndWorkspaces` call and setting of `tr.Status.TaskSpec` back out of the pod creation block, but after the possible PVC creation.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
tekton-robot pushed a commit that referenced this issue Sep 29, 2022
fixes #5574

With #5537, the call to `applyParamsContextsResultsAndWorkspaces` and setting of `tr.Status.TaskSpec` to the output of that call was moved from happening with every call to `reconcile` to only happening if there wasn't already a pod created. This didn't cause any problems with execution, but it sometimes resulted in `tr.Status.TaskSpec` not getting set properly or getting reset to `nil` on a subsequent `reconcile` run, with the end result that, sometimes, `tr.Status.TaskSpec` would contain the original `TaskSpec` without parameter, result, context, and workspace references being replaced with the corresponding value. This caused flaky failures in the `TestPipelineRunStatusSpec/pipeline_status_spec_updated` e2e test, and integration test failures in Chains (tektoncd/chains#577).

This change moves the PVC creation out of the `if pod == nil {` block that creates the pod if needed, while still checking if `pod` is `nil` before creating the PVC, and brings the `applyParamsContextsResultsAndWorkspaces` call and setting of `tr.Status.TaskSpec` back out of the pod creation block, but after the possible PVC creation.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
tekton-robot pushed a commit to tekton-robot/pipeline that referenced this issue Sep 29, 2022
fixes tektoncd#5574

With tektoncd#5537, the call to `applyParamsContextsResultsAndWorkspaces` and setting of `tr.Status.TaskSpec` to the output of that call was moved from happening with every call to `reconcile` to only happening if there wasn't already a pod created. This didn't cause any problems with execution, but it sometimes resulted in `tr.Status.TaskSpec` not getting set properly or getting reset to `nil` on a subsequent `reconcile` run, with the end result that, sometimes, `tr.Status.TaskSpec` would contain the original `TaskSpec` without parameter, result, context, and workspace references being replaced with the corresponding value. This caused flaky failures in the `TestPipelineRunStatusSpec/pipeline_status_spec_updated` e2e test, and integration test failures in Chains (tektoncd/chains#577).

This change moves the PVC creation out of the `if pod == nil {` block that creates the pod if needed, while still checking if `pod` is `nil` before creating the PVC, and brings the `applyParamsContextsResultsAndWorkspaces` call and setting of `tr.Status.TaskSpec` back out of the pod creation block, but after the possible PVC creation.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
tekton-robot pushed a commit that referenced this issue Sep 30, 2022
fixes #5574

With #5537, the call to `applyParamsContextsResultsAndWorkspaces` and setting of `tr.Status.TaskSpec` to the output of that call was moved from happening with every call to `reconcile` to only happening if there wasn't already a pod created. This didn't cause any problems with execution, but it sometimes resulted in `tr.Status.TaskSpec` not getting set properly or getting reset to `nil` on a subsequent `reconcile` run, with the end result that, sometimes, `tr.Status.TaskSpec` would contain the original `TaskSpec` without parameter, result, context, and workspace references being replaced with the corresponding value. This caused flaky failures in the `TestPipelineRunStatusSpec/pipeline_status_spec_updated` e2e test, and integration test failures in Chains (tektoncd/chains#577).

This change moves the PVC creation out of the `if pod == nil {` block that creates the pod if needed, while still checking if `pod` is `nil` before creating the PVC, and brings the `applyParamsContextsResultsAndWorkspaces` call and setting of `tr.Status.TaskSpec` back out of the pod creation block, but after the possible PVC creation.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
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. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants