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

Generate volume and volume mount names #1405

Closed
wants to merge 1 commit into from

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Oct 9, 2019

Changes

Before this, if a user wanted to attach a Volume named "workspace"
they'd get a confusing error message (#1402). #1404 improves the error
message, but it would be nice to not have an error at all and just allow
user-defined volumes named "workspace"

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

Implicit volume and volumeMount names are generated, allowing user-defined volume(mount)s named "workspace" and "home"

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Oct 9, 2019
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 9, 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/reconciler/taskrun/resources/pod.go 89.7% 90.0% 0.3

@abayer
Copy link
Contributor

abayer commented Oct 9, 2019

This would be a problem for Jenkins X - we count on the /workspace directory being named that, and users specify paths etc within /workspace in their jenkins-x.ymls. I would prefer that the default remains /workspace, with some way of overriding it to use dynamically-generated mounts.

@imjasonh
Copy link
Member Author

imjasonh commented Oct 9, 2019

I should clarify, the path /workspace is still provided, exactly as before. The name of that volume is changing from workspace to workspace-blahblah.

https://github.com/tektoncd/pipeline/pull/1405/files#diff-69ad715c7170f20be9430e47cc217bd3R104 still sets MountPath: workspaceDir (which is the const /workspace).

If JX depends on the name of the volume (not the path) being workspace then yeah we should not merge this. But I'd be curious why JX depends on the name of the volume and not just its path.

@abayer
Copy link
Contributor

abayer commented Oct 9, 2019

Aaah, OK. We definitely shouldn't be caring about the volume name, and I'm pretty sure we aren't. =)

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 Oct 9, 2019
@dlorenc
Copy link
Contributor

dlorenc commented Oct 11, 2019

/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 Oct 11, 2019
@vdemeester
Copy link
Member

@imjasonh you got linted 😝

I1011 14:35:43.687] pkg/reconciler/taskrun/resources/pod.go:111:82: `makeCredentialInitializer` - `implicitVolumes` is unused (unparam)
I1011 14:35:43.688] func makeCredentialInitializer(credsImage, serviceAccountName, namespace string, implicitVolumes []corev1.Volume, implicitVolumeMounts []corev1.VolumeMount, kubeclient kubernetes.Interface) (*v1alpha1.Step, []corev1.Volume, error) {

@vdemeester
Copy link
Member

ping @imjasonh
needs a rebase (and lint fix)

@imjasonh imjasonh force-pushed the generate-volume-names branch from 2599039 to 92fc088 Compare November 15, 2019 18:54
@tekton-robot
Copy link
Collaborator

New changes are detected. LGTM label has been removed.

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2019
Before this, if a user wanted to attach a Volume named "workspace"
they'd get a confusing error message (tektoncd#1402). tektoncd#1404 improves the error
message, but it would be nice to not have an error at all and just allow
user-defined volumes named "workspace"
@imjasonh imjasonh force-pushed the generate-volume-names branch from 92fc088 to f7551bc Compare November 15, 2019 18:56
@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/reconciler/taskrun/resources/pod.go 89.5% 89.8% 0.3

@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/reconciler/taskrun/resources/pod.go 89.5% 89.8% 0.3

@vdemeester
Copy link
Member

@imjasonh still need a rebase 😅

@imjasonh
Copy link
Member Author

Yeah I'm just going to abandon this in the face of #1605

@imjasonh imjasonh closed this Nov 25, 2019
@imjasonh
Copy link
Member Author

I wonder whether a better way to handle this would be to explicitly reserve volume names starting with tekton-internal- or something, and reject user-specified conflicting volumes upfront.

Any objections?

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 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.

7 participants