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

Add support for repeated PVC-claim but using subPath in AA-validation #3099

Merged
merged 1 commit into from Sep 9, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Aug 13, 2020

Changes

Picks up from #3091 and adds some tests for the validation. Original commit message:

The validation for compatibility with the Affinity Assistant does not
support the same PVC repeated, but using different subPaths.

This patch adds support for this case and tests for the validation.

Co-authored-by: Scott sbws@google.com

Closes #3085

Closes #3091

/kind bug

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

Release Notes

Fixes a bug with validation for the Affinity Assistant when the same PVC is used for multiple workspaces but with different subPaths

@ghost ghost requested a review from jlpettersson August 13, 2020 15:24
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Aug 13, 2020
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 13, 2020
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/taskrun.go 78.3% 78.0% -0.3

Copy link
Member

@jlpettersson jlpettersson left a comment

Choose a reason for hiding this comment

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

Thanks for the help!!
Looks good!
/lgtm

// ValidateOnlyOnePVCIsUsed checks that a list of WorkspaceBinding uses only
// one persistent volume claim. This is useful to validate that WorkspaceBindings
// are compatible with affinity rules enforced by the AffinityAssistant.
func ValidateOnlyOnePVCIsUsed(wb []v1beta1.WorkspaceBinding) error {
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe add to the comment that this condition (multiple pvcs) is valid for WorkspaceBinding in a PipelineRun, but not for a TaskRun

Copy link
Author

Choose a reason for hiding this comment

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

good thinking; I've updated the comment to include that detail.

Copy link
Member

Choose a reason for hiding this comment

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

This is useful to validate that WorkspaceBindings
// in PipelineRuns are compatible with affinity rules enforced by the
// AffinityAssistant.

It's the other way around :) . We only call this function from taskrun.go because this condition is ok when declared in a PipelineRun

Copy link
Member

Choose a reason for hiding this comment

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

Maybe

// This is only useful to validate that WorkspaceBindings
// in TaskRuns are compatible with affinity rules enforced by the
// AffinityAssistant.

Copy link
Author

Choose a reason for hiding this comment

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

oops, hah, thanks I've corrected it with your wording.

@tekton-robot tekton-robot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Aug 13, 2020
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/taskrun.go 78.3% 78.0% -0.3

The validation for compatibility with the Affinity Assistant does not
support the same PVC repeated, but using different subPaths.

This patch adds support for this case and tests for the validation.

Co-authored-by: Scott <sbws@google.com>
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/taskrun.go 78.3% 78.0% -0.3

@imjasonh
Copy link
Member

imjasonh commented Sep 2, 2020

Do we want this PR in the v0.16 release milestone?

@jlpettersson
Copy link
Member

Do we want this PR in the v0.16 release milestone?

I think so, unless we want it in a patch. It should be in a v0.15.x also.

Copy link
Member

@vdemeester vdemeester 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 tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 8, 2020
@bobcatfish
Copy link
Collaborator

/lgtm

@bobcatfish
Copy link
Collaborator

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish, jlpettersson

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 9, 2020
@bobcatfish bobcatfish added this to the Pipelines v0.16 milestone Sep 9, 2020
@tekton-robot tekton-robot merged commit a162a1d into tektoncd:master Sep 9, 2020
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/bug Categorizes issue or PR as related to a bug. 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
None yet
Development

Successfully merging this pull request may close these issues.

0.15.0: "TaskRun mounts more than one PersistentVolumeClaim" despite single PVC w/ workspace subDirs
5 participants