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

Adds Env to TaskRunSpec #1657

Closed
wants to merge 1 commit into from
Closed

Adds Env to TaskRunSpec #1657

wants to merge 1 commit into from

Conversation

poy
Copy link
Contributor

@poy poy commented Dec 1, 2019

Changes

Adds a Env field to TaskRunSpec to allow a user to set environment
variables on each step container. This mimics Knative-Build's
TemplateInstantiationSpec's Env field.

Setting environment variables is useful for when a TaskRun author may
not know what variables are required ahead of time (e.g., Buildpacks).

fixes #1606

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

Describe any user facing changes here, or delete this block.

Examples of user facing changes:
- API changes
- Bug fixes
- Any changes in behavior

Adds a `Env` field to `TaskRunSpec` to allow a user to set environment
variables on each step container. This mimics Knative-Build's
`TemplateInstantiationSpec`'s `Env` field.

Setting environment variables is useful for when a `TaskRun` author may
not know what variables are required ahead of time (e.g., Buildpacks).

fixes tektoncd#1606
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign bobcatfish
You can assign the PR to them by writing /assign @bobcatfish in a comment when ready.

The full list of commands accepted by this bot can be found 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

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Dec 1, 2019
@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 Dec 1, 2019
@tekton-robot
Copy link
Collaborator

Hi @poy. 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.

@imjasonh
Copy link
Member

imjasonh commented Dec 1, 2019

/ok-to-test
/hold
(For 0.10)

I need to think about how this interacts with task.spec.stepTemplate. Probably the TaskRun should win any conflicts.

@tekton-robot tekton-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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 Dec 1, 2019
@imjasonh
Copy link
Member

imjasonh commented Dec 1, 2019

/assign

@poy
Copy link
Contributor Author

poy commented Dec 1, 2019

@imjasonh I followed the existing pattern established with implicitEnvVars hoping to do just that 😁

@bobcatfish
Copy link
Collaborator

Thanks for the contribution @poy! Before we merge this, we should discuss the design and make sure we want to add this - as mentioned in #1606 (comment) this is something we have deliberately not added support for in the past, so I'd like to dig a bit more into the use case you described in #1606 (comment) so we can understand it a bit better before merging.

/hold

@cccfeng
Copy link
Contributor

cccfeng commented Dec 14, 2019

Hi everyone, it's nice to see some discussions and code changes on supporting dynamic environment variables. I would like to ask how can users support dynamic env through pipelineRun?

@poy
Copy link
Contributor Author

poy commented Dec 14, 2019

Hey @cccfeng, I would recommend you join the discussion in #1606

@bobcatfish
Copy link
Collaborator

I'm assuming we can close this for now and continue the discussion in #1606 but plz reopen if I'm wrong @poy!

@bobcatfish bobcatfish closed this Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

Provide mechanism to set environment variables on TaskRuns
6 participants