Skip to content

Conversation

vdemeester
Copy link
Member

Changes

In case of the PVC creation (from volumeclaimtemplate) is due to a
quota error (quota exceeded), do not fail with a permanent error, and
instead mark the PipelineRun as pending. Once there is some quota
available back, it will be able to start.

Signed-off-by: Vincent Demeester [email protected]

Closes #7672

/kind feature

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • pre-commit Passed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

PipelineRun do not fail anymore if the pvc creation is due to an exceeded quota ; it will be requeued instead (until quota is available or it times out)

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 22, 2025
@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 22, 2025
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 22, 2025
@vdemeester
Copy link
Member Author

/wip
I need to update/create some e2e tests and makes sure it times out.

@vdemeester vdemeester added this to the v1.3.0 (LTS) milestone Jul 22, 2025
@vdemeester vdemeester force-pushed the 7672-retry-pvc-quota branch from 4a5edbf to 52464a8 Compare July 22, 2025 10:53
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 91.6% 91.2% -0.4
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 77.4% -6.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 91.6% 91.2% -0.4
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 77.4% -6.3

@vdemeester
Copy link
Member Author

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2025
@vdemeester vdemeester force-pushed the 7672-retry-pvc-quota branch from 52464a8 to 6b0c7ae Compare July 23, 2025 09:22
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 23, 2025
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 91.6% 91.2% -0.4
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 77.4% -6.3

@vdemeester
Copy link
Member Author

/retest

@vdemeester
Copy link
Member Author

Timeout is taken into account 👼🏼

@twoGiants
Copy link
Member

/assign

@twoGiants
Copy link
Member

/cc @twoGiants

@tekton-robot tekton-robot requested a review from twoGiants July 24, 2025 15:44
Copy link
Member

@twoGiants twoGiants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, it makes sense to set the status to pending and let it retry 😸 👍.

Now it will re-queue right away. Do you want to make it configurable at some point like suggested in the issue?

My comments are below. I would add unit tests, simplify the conditional logic and remove the re-declaration of the errors in affinity_assistant.go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests for the new conditional logic in CreatePVCFromVolumeClaimTemplate should be added.

@@ -577,54 +577,56 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCs_Failure(t *testing.T) {
name: "pvc creation failed - per workspace",
failureType: "pvc",
aaBehavior: aa.AffinityAssistantPerWorkspace,
expectedErr: fmt.Errorf("%w: failed to create PVC pvc-b9eea16dce: error creating persistentvolumeclaims", ErrPvcCreationFailed),
expectedErr: fmt.Errorf("%w for pvc-b9eea16dce: error creating persistentvolumeclaims", ErrPvcCreationFailed),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use volumeclaim.ErrPvcCreationFailed instead, then you don't need to re-declare them in affinity_assistant.go.

@vdemeester vdemeester modified the milestones: v1.3.0 (LTS), v1.4.0 Jul 30, 2025
…quotas

In case of the PVC creation (from volumeclaimtemplate) is due to a
quota error (quota exceeded), do not fail with a permanent error, and
instead mark the PipelineRun as pending. Once there is some quota
available back, it will be able to start.

Signed-off-by: Vincent Demeester <[email protected]>
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.1% 91.6% -0.5
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 75.9% -7.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.1% 91.6% -0.5
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 75.9% -7.7

@waveywaves
Copy link
Member

/retest

@vdemeester vdemeester force-pushed the 7672-retry-pvc-quota branch 2 times, most recently from 69cc896 to 0758e65 Compare August 20, 2025 08:13
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.1% 91.6% -0.5
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 75.9% -7.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.1% 91.6% -0.5
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 88.9% 5.2

@vdemeester vdemeester force-pushed the 7672-retry-pvc-quota branch from 0758e65 to 3c2ea80 Compare August 20, 2025 08:42
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.1% 91.6% -0.5

@vdemeester vdemeester force-pushed the 7672-retry-pvc-quota branch from 3c2ea80 to e0410bf Compare August 20, 2025 10:03
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.1% 91.6% -0.5
pkg/reconciler/volumeclaim/pvchandler.go 83.7% 88.9% 5.2

@waveywaves waveywaves self-assigned this Aug 20, 2025
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2025
Copy link
Member

@aThorp96 aThorp96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aThorp96, waveywaves

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot
Copy link
Collaborator

@khrm: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vdemeester vdemeester added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2025
@tekton-robot tekton-robot merged commit c836c24 into tektoncd:main Aug 20, 2025
27 checks passed
@vdemeester vdemeester deleted the 7672-retry-pvc-quota branch August 20, 2025 16:38
@aThorp96
Copy link
Member

I believe the isConflict() addition here is necessary because of this kubernetes bug: kubernetes/kubernetes#67761

@mbpavan
Copy link

mbpavan commented Aug 29, 2025

/cherry-pick release-v1.3.x

1 similar comment
@waveywaves
Copy link
Member

/cherry-pick release-v1.3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

volumeClaimTemplate and exceeded quota for PVC (and requeues ?)
7 participants