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 volumeClaimTemplate name to be not provided #2450

Closed
bobcatfish opened this issue Apr 20, 2020 · 1 comment · Fixed by #2453
Closed

Allow volumeClaimTemplate name to be not provided #2450

bobcatfish opened this issue Apr 20, 2020 · 1 comment · Fixed by #2453
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Comments

@bobcatfish
Copy link
Collaborator

Expected Behavior

Since the tekton controller is completely managing the lifecycle of PVCs created with volumeClaimTemplate, as an author of a Run specifying it, i might not care what the name of the PVC is. I'd love it if the controller could automatically generate one for me so I can skip the whole metadata section of the template if I don't need it.

Actual Behavior

It looks like the PVC created will have a name with this format:

fmt.Sprintf("%s-%s-%s", claimName, workspaceName, pipelineRunName)

Additional Info

The feature was added in #2326

@bobcatfish bobcatfish added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Apr 20, 2020
@jlpettersson
Copy link
Member

jlpettersson commented Apr 20, 2020

I'd love it if the controller could automatically generate one for me so I can skip the whole metadata section of the template if I don't need it.

fmt.Sprintf("%s-%s-%s", claimName, workspaceName, pipelineRunName)

Since there always will be a workspaceName and a pipelineRunName, the PVC name will be -<claimName>-<pipelineRunName> and fail because the k8s compatible name can not start with a dash. We could omit the first dash in this case and let the PVC get the name <claimName>-<pipelineRunName> ?

e.g. if claimName is empty, use PVC name:

fmt.Sprintf("%s-%s", workspaceName, pipelineRunName)

jlpettersson added a commit to jlpettersson/pipeline that referenced this issue Apr 21, 2020
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 added a commit to jlpettersson/pipeline that referenced this issue Apr 21, 2020
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
tekton-robot pushed a commit that referenced this issue Apr 22, 2020
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 #2450
jlpettersson added a commit to jlpettersson/community that referenced this issue 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 issue 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
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants