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

Validate missing volume configs in Workspace Bindings #3096

Merged
merged 1 commit into from Aug 13, 2020
Merged

Validate missing volume configs in Workspace Bindings #3096

merged 1 commit into from Aug 13, 2020

Conversation

ghost
Copy link

@ghost ghost commented Aug 12, 2020

Changes

Contributes to #3089 but doesn't completely fix it. There's another bug hidden in there that a PipelineRun submitting a TaskRun with invalid workspace is not entering a failed state even though the TaskRun reconciler is loudly complaining about the workspace config.

When a PipelineRun specifies a Workspace Binding, it is required to
submit the volume configuration as part of that Binding. Currently
the volume details aren't validated and so a PipelineRun with a Workspace
Binding that only includes a "name" field will validate. The end
result is that the Workspace is passed to the TaskRun and fails
validation there instead.

This commit adds validation to PipelineRuns to ensure that any
Workspaces passed include some correct volume configuration data.

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)
Fix an issue where PipelineRuns would pass validation even when a workspace binding was missing required volume info.

When a PipelineRun specifies a Workspace Binding, it is required to
submit the volume configuration as part of that Binding. Currently
the volume details aren't validated and so a PipelineRun with a Workspace
Binding that only includes a "name" field will validate. The end
result is that the Workspace is passed to the TaskRun and fails
validation there instead.

This commit adds validation to PipelineRuns to ensure that any
Workspaces passed include some correct volume configuration data.
@ghost ghost added the kind/bug Categorizes issue or PR as related to a bug. label Aug 12, 2020
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 12, 2020
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 12, 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/apis/pipeline/v1beta1/pipelinerun_validation.go 96.0% 96.4% 0.4

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 Aug 12, 2020
@dlorenc
Copy link
Contributor

dlorenc commented Aug 13, 2020

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlorenc

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 Aug 13, 2020
"workspace.emptydir",
"workspace.configmap",
"workspace.secret",
"persistentvolumeclaim",
Copy link
Contributor

Choose a reason for hiding this comment

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

nice catch!

@vdemeester vdemeester added kind/bug Categorizes issue or PR as related to a bug. and removed kind/bug Categorizes issue or PR as related to a bug. labels Aug 13, 2020
@tekton-robot tekton-robot merged commit 8f58604 into tektoncd:master Aug 13, 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants