-
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 support for env in podtemplate #3566
Conversation
The following is the coverage report on the affected files.
|
This look good, maybe add an example ? The same way we have on that example ? |
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.
please add the env field to the supported fields table in https://github.com/tektoncd/pipeline/blob/ab723e9e79d358b6397cc62a199ba4c489ee3480/docs/podtemplates.md
2f8e3aa
to
040e259
Compare
The following is the coverage report on the affected files.
|
@chmouel @vdemeester @jerop I have updated the PR with tests, docs and examples |
040e259
to
4308ef2
Compare
The following is the coverage report on the affected files.
|
4308ef2
to
45b6d40
Compare
The following is the coverage report on the affected files.
|
45b6d40
to
96f664d
Compare
This will help to specificy env default, env at pipelinerun and taskrun level. Env in pod template at taskrun and pipelinerun level will take precedence over one defined in step and stepTemplate Env at pipelinerun and taskrun level will override the default podtemplate Fix tektoncd#1606
96f664d
to
eb22c76
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
[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 |
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.
I'm surprised we didn't want to go ahead with a TEP on this @vdemeester ?
I traced back in the API working group notes and found our discussion on july 20
I know it's a pain to ask for a TEP after the work is already done, but I feel like if it wasn't already done, a TEP would be totally reasonable? Esp. given that this is controversial - or at least it is controversial to me b/c I think folks could use this in such a way that Tekton will replicate the mistakes of other CI/CD systems (which is ironically the motivation for this feature afaik, e.g. migrating from jenkins)
A couple things we might want to cover in a TEP:
- do we want to do this in the pod template or do we want this to be a top level feature? (so it's more obvious) this would also give us more control over which containers these env vars are provided to if we want it
- one thing in the working group I suggested was do we want to make it so that Tasks have to opt into this functionality somehow, i.e. so when you look at a task it's obvious it will also accept some undeclared list of env vars
/hold
@@ -49,6 +49,10 @@ Pod templates support fields listed in the table below. | |||
<td><code>volumes</code></td> | |||
<td>Specifies a list of volumes that containers within the Pod can mount. This allows you to specify a volume type for each <code>volumeMount</code> in a <code>Task</code>.</td> | |||
</tr> | |||
<tr> | |||
<td><code>env</code></td> | |||
<td>Specifies a list of environments that all containers within the Pod will be populated</td> |
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.
nit: environments -> environment variables?
Agreed on all those 🙃 |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
The following is the coverage report on the affected files.
|
@piyush-garg: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
1 similar comment
@piyush-garg: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
@piyush-garg: PR needs rebase. 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. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closed this PR. 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. |
@vdemeester @piyush-garg any plan to bring this back to live? AFAIK most of the discussion already happened, it was only a matter of formalising it via TEP? |
This document proposes support for environment variables configuration in `podTemplate`. That allows to exclude common variables to the global level as well as overwrite defaults specified on the particular step level.
This will help to specificy env default, env at pipelinerun
and taskrun level. Env in pod template at taskrun and pipelinerun
level will take precedence over one defined in step and stepTemplate
Env at pipelinerun and taskrun level will override the
default podtemplate
Fix #1606
/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