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

Only make a PVC for a PipelineRun if we need to. 🗑️ #1545

Merged
merged 1 commit into from
Nov 12, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Nov 8, 2019

Changes

We only need to make a PVC if a Pipeline contains tasks that declare Output
resources of the allowed types. This PR changes our detection to only create
a PVC under those conditions.

This was originally attempted in #1007 and
then subsequently rolled back in #1071. I
think this one gets the logic correct :)

Co-authored-by: Christie Wilson [email protected]
Fixes: #937

Submitter Checklist

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

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

PVCs for output -> input linking will now be created only when that linking is actually present in a Pipeline, fixing #937 (used to be created for all Pipelines that included any Task with an Output).

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 8, 2019
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/artifacts/artifacts_storage.go 81.5% 80.7% -0.8
pkg/reconciler/taskrun/resources/output_resource.go 89.7% 90.5% 0.7

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/artifacts/artifacts_storage.go 81.5% 80.7% -0.8
pkg/reconciler/taskrun/resources/output_resource.go 89.7% 90.5% 0.7

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

Amazing!!! 😎

@dlorenc the one thing I can't verify is if after #1068 we made sure to add an example and/or integration test that covered that case (a pipeline with one task that had an output) b/c i feel like before we merge this we should be sure that we don't cause that bug to come back (reasoning through it i'm pretty sure we won't but just in case!)

/approve

var newSteps []v1alpha1.Step
for _, dPath := range boundResource.Paths {
newSteps = append(newSteps, as.GetCopyToStorageFromSteps(resource.GetName(), sourcePath, dPath)...)
needsPvc = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice, i think this is the key that makes it work which we were missing in our previous attempts @dlorenc ?

b/c in the first attempt we didnt change this at all, and then in #1069 my massive hack was too hacky - i was looking to see if the PVC existed when actually we could just check if this path was bound 🤦‍♀️

One detail is that we had sort of intended that path be something that could be generically provided by users - but im pretty sure that actually didn't work (and hope we'll remove it forever one day soon 🙏 ) and this block should only be hit in the PipelineRun case anyway, in which case there's no way for the user to provide the value sooooo

long story short 🎉 🎉 🎉

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2019
@bobcatfish bobcatfish added cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit and removed cla: no labels Nov 8, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

We only need to make a PVC if a Pipeline contains tasks that declare Output
resources of the allowed types. This PR changges our detection to only create
a PVC under those conditions.

This was originally attempted in tektoncd#1007 and
then subsequently rolled back in tektoncd#1071. I
*think* this one gets the logic correct :)

Co-authored-by: Christie Wilson <[email protected]>
Fixes: tektoncd#937
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit labels Nov 8, 2019
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/artifacts/artifacts_storage.go 81.5% 80.7% -0.8
pkg/reconciler/taskrun/resources/output_resource.go 89.7% 90.5% 0.7

@dlorenc dlorenc added cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit and removed cla: no labels Nov 8, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

Copy link
Member

@dibyom dibyom 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 Nov 12, 2019
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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

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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. 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.

Tekton Creates PVC unnecessarily if volumes are defined
5 participants