-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add variable expansion for params in Projected Volume fields #2601
Add variable expansion for params in Projected Volume fields #2601
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/meow
/cc @sbwsg
In response to this:
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. |
[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 |
/lgtm I had no idea we already supported substitution for other volume types. Thanks @jlpettersson ! |
Oh, we should probably also document this! |
@sbwsg yes. This is variable expansion for But I think that I instead should document on how to use Projected Volumes since that is usable with |
Created #2605 to record all variable expansion locations. |
/test pull-tekton-pipeline-integration-tests |
Is there a documentation change that would make sense to add with this? |
ah kk
It does seem like something that would make sense to document, but I understand not wanting to take that on when there is no precedent. Documenting projected volumes as well makes sense, but I think it makes sense to be able to refer to docs that show you where you can use the variable replacement |
/test tekton-pipeline-unit-tests |
Fails on this now
|
@jlpettersson can you rebase against master ? |
53d6395
to
df7e19e
Compare
Am I hitting this feature gate?
Is this test running on a cluster with different configuration/version than earlier tests? |
/test tekton-pipeline-unit-tests |
Nah, this is the linter, it shouldn't fail on this (and it doesn't have anything to do with the cluster the build are run into)… This is a weird error… /retest |
@jlpettersson actually the error is legit λ make golangci-lint
🐱 getting golangci-lint v1.25.0
golangci/golangci-lint info checking GitHub for tag 'v1.25.0'
golangci/golangci-lint info found version: 1.25.0 for v1.25.0/linux/amd64
golangci/golangci-lint info installed /home/vincent/src/github.com/tektoncd/pipeline/.bin/golangci-lint
🐱 running golangci-lint…
WARN [runner] Can't run linter goanalysis_metalinter: gocritic: analysis skipped: errors in package: [/home/vincent/src/github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources/apply_test.go:132:5: unknown field Name in struct literal /home/vincent/src/github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources/apply_test.go:133:5: unknown field VolumeSource in struct literal]
ERRO Running error: gocritic: analysis skipped: errors in package: [/home/vincent/src/github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources/apply_test.go:132:5: unknown field Name in struct literal /home/vincent/src/github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources/apply_test.go:133:5: unknown field VolumeSource in struct literal]
make: *** [Makefile:150: golangci-lint] Error 3
⛄ λ go test ./pkg/reconciler/taskrun/resources/...
# github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources_test [github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources.test]
pkg/reconciler/taskrun/resources/apply_test.go:132:5: unknown field 'Name' in struct literal of type "k8s.io/api/core/v1".EnvFromSource
pkg/reconciler/taskrun/resources/apply_test.go:133:5: unknown field 'VolumeSource' in struct literal of type "k8s.io/api/core/v1".EnvFromSource
FAIL github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources [build failed]
ok github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources/cloudevent 0.013s
FAIL
|
df7e19e
to
4d2babc
Compare
Thank you @vdemeester ! I did not notice this. But a part of the code was actually moved to a similar part. I got the error locally as well now. It must have happened during my |
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.
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.
A [projected volume](https://kubernetes.io/docs/concepts/storage/volumes/#projected) can mount/project files from `Secrets`, `ConfigMaps` and `ServiceAccountTokens`. Is is good if the end user can choose the name of `Secrets`, `ConfigMaps` and the audience of `ServiceAccountTokens`. With this commit, the task author can use `params` for `secret.name`, `configmap.name` and `serviceaccounttoken.audience` in a Projected Volume. See examples of use cases in tektoncd#2597 Fixes tektoncd#2597
4d2babc
to
4215ec5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
/lgtm
Changes
A projected volume can mount/project files from
Secrets
,ConfigMaps
andServiceAccountTokens
.It is good if the end-user can choose the name of
Secrets
,ConfigMaps
and the audience ofServiceAccountTokens
. With this commit, the task author can useparams
forsecret.name
,configmap.name
andserviceaccounttoken.audience
in a Projected Volume.Example usage:
See more example use cases in #2597
Fixes #2597
/kind feature
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:
cmd
dir, please updatethe release Task to build and release this image.
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