-
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
Implement templating within containerTemplate. #1006
Conversation
Before, ApplyReplacements() would apply templating replacements to the containers within spec.Steps, but never to the single container at spec.ContainerTemplate. Note that this didn't work earlier because containerTemplate is merged with the container spec after templating is applied. Isolate the container-specific templating in applyContainerReplacements() and apply that logic to the containerTemplate field. This addresses tektoncd#811.
/test pull-tekton-pipeline-integration-tests |
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.
One nit, otherwise looking good ! 💃
@@ -17,6 +17,8 @@ limitations under the License. | |||
package resources | |||
|
|||
import ( | |||
corev1 "k8s.io/api/core/v1" |
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: This import needs to be above 👼
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: EliZucker, 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 |
|
||
// Apply variable expansion to containerTemplate fields. | ||
if spec.ContainerTemplate != nil { | ||
applyContainerReplacements(spec.ContainerTemplate, replacements) |
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 just realized we need to do this for stepTemplate
as well @EliZucker 😅
lemme know if you don't want to do it, I can open a bug also
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.
See this PR!
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.
whoa so fast! thanks @EliZucker :D
Changes
Taken from my commit message:
Before, ApplyReplacements() would apply templating replacements to the containers within spec.Steps, but never to the single container at spec.ContainerTemplate. Note that this didn't work earlier because containerTemplate is merged with the container specs after templating is applied.
Isolate the container-specific templating in applyContainerReplacements()
and apply that logic to the containerTemplate field.
This addresses #811.
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.
Release Notes
I modeled the note above from this similar PR for consistency.