-
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
TEP-0101 PodTemplate should support environment variables. #5699
Conversation
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
eb678f2
to
b28f802
Compare
The following is the coverage report on the affected files.
|
/retest |
The following is the coverage report on the affected files.
|
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.
/cc @piyush-garg
/cc @afrittoli |
The following is the coverage report on the affected files.
|
Hi @JeromeJu, @vdemeester and @afrittoli Running codegen after updating to latest main branch adds a whole bunch of stuff not related to this commit. |
The following is the coverage report on the affected files.
|
/kind feature |
opened #5764 to fix codegen out of sync issue. |
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.
Mostly LGTM, just some minor nits. Thanks for the PR ❤️
Thank you @XinruZhang ! for taking a look, please take a look again |
value: "false" | ||
``` | ||
|
||
_In the above example the environment variable `TEST_TEKTON` will not be overriden by value specified in podTemplate, because the `config-default` option `default-forbidden-env` is configured with value `TEST_TEKTON`._ |
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.
Should a webhook validation error be thrown if a user is trying to update a forbidden env
? Might be better user experience this way instead of allowing a user to provide it and silently rejecting it?
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.
Apart from the behaviour of how to deal with podTemplate that try to update forbidden-env, it looks good!
@ScrapCodes - it seems there's an unaddressed feedback from @afrittoli and @chitrangpatel, do you think they'd be resolved soon? wondering if I should move this PR to the next milestone - hoping to cut v0.43 tomorrow |
/hold cancel |
Hi @chitrangpatel, do you think - we can add the webhook validations in a separate pull request? |
Yes, that's completely fine. |
Thank you @chitrangpatel ! |
The following is the coverage report on the affected files.
|
@@ -334,5 +337,8 @@ func validateTaskRunSpec(ctx context.Context, trs PipelineTaskRunSpec) (errs *ap | |||
errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "computeResources", config.AlphaAPIFields).ViaField("computeResources")) | |||
errs = errs.Also(validateTaskRunComputeResources(trs.ComputeResources, trs.StepOverrides)) | |||
} | |||
if trs.TaskPodTemplate != nil { | |||
errs = errs.Also(validatePodTemplateEnv(ctx, *trs.TaskPodTemplate)) | |||
} |
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.
shouldn't there be a similar update to v1/pipelinerun_validation.go
?
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
1. Envs i.e. environment variables specified in podTemplate for PipelineRun and TaskRun, will take precdence over envs defined in step and StepTemplate. 2. config-defaults' default-pod-template can contain global default envs applicable for all PipelineRun and taskRun. These are overriden by user defined podTemplate. TEP-101 Support forbidden envs. 1. A new config-default configuration: default-forbidden-envs 2. Envs added in the default-forbidden-envs are filtered while updating from a podTemplate.
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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.
Thank you for the update @ScrapCodes !
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, chitrangpatel, vdemeester, XinruZhang 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 |
@chitrangpatel ok to merge this? @ScrapCodes implemented both |
@jerop this should be ready to merge and be included in v0.43 |
Yes! All good! |
/lgtm |
Changes
a. A new config-default configuration: forbidden-envs
b. Envs added in the forbidden-envs are filtered while updating from a podTemplate.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind tep