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

Allow omitting metadata in volumeclaimtemplate #2453

Conversation

jlpettersson
Copy link
Member

Changes

Workspaces can be backed by a PVC that is created from a user provied template, e.g.

workspaces:
- name: ws
  volumeClaimTemplate:
    metadata:
      name: ws-pvc
    spec:
      accessModes: ["ReadWriteOnce"]
      resources:
         requests:
            storage: 1Gi

but this might fail if the user did not provide a metadata.name on the
template, since the PVC name would be -<ws-name>-<run-name> and names
starting with a - is not allowed for PVCs.

This commits omit the first - in the PVC name, if the user did not
provide a name or metadata part of the volumeclaimtemplate.

Now this is a valid template:

workspaces:
- name: ws
  volumeClaimTemplate:
    spec:
      accessModes: ["ReadWriteOnce"]
      resources:
         requests:
            storage: 1Gi

I also added license banners to the two pvc-related go files.

Fixes #2450

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.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Apr 21, 2020
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 21, 2020

CLA Check
The committers are authorized under a signed CLA.

@tekton-robot tekton-robot requested review from dibyom and a user April 21, 2020 11:19
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 21, 2020
@tekton-robot
Copy link
Collaborator

Hi @jlpettersson. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

Workspaces can be backed by a PVC that is created from a user provied template, e.g.

    workspaces:
      - name: ws
        volumeClaimTemplate:
          metadata:
            name: ws-pvc
          spec:
            accessModes: ["ReadWriteOnce"]
            resources:
               requests:
                  storage: 1Gi

 but this might fail if the user did not provide a `metadata.name` on the
 template, since the PVC name would be `-<ws-name>-<run-name>` and names
 starting with a `-` is not allowed for PVCs.

 This commits omit the first `-` in the PVC name, if the user did not
 provide a name or metadata part of the volumeclaimtemplate.

 I also added license banners to the two pvc-related go files.

 Fixes tektoncd#2450
@jlpettersson jlpettersson force-pushed the allow_omitting_metadata_in_volumeclaimtemplate branch from 9307b1a to b9a0b64 Compare April 21, 2020 11:29
@ghost
Copy link

ghost commented Apr 21, 2020

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 21, 2020
@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/volumeclaim/pvchandler.go 87.0% 88.0% 1.0

@jlpettersson
Copy link
Member Author

process 474 exited with code 1 after 28.3m

/test pull-tekton-pipeline-integration-tests

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.

/meow

@tekton-robot
Copy link
Collaborator

@vdemeester: cat image

In response to this:

/meow

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.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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 Apr 21, 2020
@dibyom
Copy link
Member

dibyom commented Apr 22, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2020
@tekton-robot tekton-robot merged commit 7a2bc9c into tektoncd:master Apr 22, 2020
@afrittoli afrittoli added the kind/bug Categorizes issue or PR as related to a bug. label Apr 30, 2020
jlpettersson added a commit to jlpettersson/community that referenced this pull request May 19, 2020
Jonas has recently become a regularly contributor. He started with adding a minor [_missing_ `omitempty`](tektoncd/pipeline#2301) and then [proposed some ideas](tektoncd/pipeline#1986 (comment)) around workspaces and PersistentVolumeClaim creation and continued to [elaborate around those ideas](tektoncd/pipeline#1986 (comment)). A sunny day a few days later, he also submitted an [extensive implementation for volumeClaimTemplate](tektoncd/pipeline#2326), corresponding to the idea discussions.

A few days later submitted a [small refactoring PR](tektoncd/pipeline#2392), and he also listened to community members that [proposed changes](tektoncd/pipeline#2450) to his implementation about volumeClaimTemplates and did an [implementation for that proposal](tektoncd/pipeline#2453).

A rainy day, he also wrote [technical documentation about PVCs](tektoncd/pipeline#2521) including adding an example that caused _flaky_ integration tests for the whole community during multiple days. When he understood his mistake, he submitted a [removal of the example](tektoncd/pipeline#2546) that caused flaky tests.

He has also put his toe into Tekton Catalog and [contributed to the buildah task](tektoncd/pipeline#2546).

This has followed, mostly with more PRs to the Pipeline project:

- tektoncd/pipeline#2460
- tektoncd/pipeline#2491
- tektoncd/pipeline#2502
- tektoncd/pipeline#2506
- tektoncd/pipeline#2632
- tektoncd/pipeline#2633
- tektoncd/pipeline#2634
- tektoncd/pipeline#2636
- tektoncd/pipeline#2601
- tektoncd/pipeline#2630

Jonas is excited about the great community around Tekton and the project! He now would like to join the org.
tekton-robot pushed a commit to tektoncd/community that referenced this pull request May 20, 2020
Jonas has recently become a regularly contributor. He started with adding a minor [_missing_ `omitempty`](tektoncd/pipeline#2301) and then [proposed some ideas](tektoncd/pipeline#1986 (comment)) around workspaces and PersistentVolumeClaim creation and continued to [elaborate around those ideas](tektoncd/pipeline#1986 (comment)). A sunny day a few days later, he also submitted an [extensive implementation for volumeClaimTemplate](tektoncd/pipeline#2326), corresponding to the idea discussions.

A few days later submitted a [small refactoring PR](tektoncd/pipeline#2392), and he also listened to community members that [proposed changes](tektoncd/pipeline#2450) to his implementation about volumeClaimTemplates and did an [implementation for that proposal](tektoncd/pipeline#2453).

A rainy day, he also wrote [technical documentation about PVCs](tektoncd/pipeline#2521) including adding an example that caused _flaky_ integration tests for the whole community during multiple days. When he understood his mistake, he submitted a [removal of the example](tektoncd/pipeline#2546) that caused flaky tests.

He has also put his toe into Tekton Catalog and [contributed to the buildah task](tektoncd/pipeline#2546).

This has followed, mostly with more PRs to the Pipeline project:

- tektoncd/pipeline#2460
- tektoncd/pipeline#2491
- tektoncd/pipeline#2502
- tektoncd/pipeline#2506
- tektoncd/pipeline#2632
- tektoncd/pipeline#2633
- tektoncd/pipeline#2634
- tektoncd/pipeline#2636
- tektoncd/pipeline#2601
- tektoncd/pipeline#2630

Jonas is excited about the great community around Tekton and the project! He now would like to join the org.
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 kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Allow volumeClaimTemplate name to be not provided
6 participants