Closed afrittoli closed 4 years ago
/kind bug /cc @ImJasonH
I have an idea of what may be happening. MakePod applies the template merge first, and the script to container then. However the template merge code does a three-ways merge between the template, an empty container and the original step, into a container. Finally the merge code brings back the step with steps[i] = Step{Container: *merged}
.
Since "script" is not a container field, it's dropped along the way.
One possible way to solve this would be to resolve the script to regular containers first and do the merge then. The side effect would be that the template would be applied to the container that generates the script too, but that's probably ok, and there may be ways to avoid that.
The other alternative is in the merge code to take in account the 'Script' part explicitly.
(p.s. beautifully written issue @afrittoli :heart_eyes: !!)
Expected Behavior
I can use
script
mode in a step and usestepTemplate
as well.Actual Behavior
When a
stepTemplate
is added to theTask
, theplace-scripts
container disappears, andentrypoint
in step container runs/bin/sh
instead of the script.Steps to Reproduce the Problem
I'm using the following task:
I run the task with
tkn
:The resulting pod (status excluded):
Additional Info