grim/convey

Fix script env mapping.

2017-10-07, Eric Fritz
2f14f79d7995
Parents 56ac94bda3fd
Children b35fa6c81f34
Fix script env mapping.
--- a/docker/run.go Wed Oct 04 15:32:37 2017 -0500
+++ b/docker/run.go Sat Oct 07 11:12:10 2017 -0500
@@ -120,7 +120,12 @@
// set the run command argument to the script file
commandArg := scriptFile
- scripts, err := st.MapSlice(r.Script, fullEnv)
+ // Scripts must retain order, so don't use st.MapSlice to
+ // expand things (which results in a non-deterministically
+ // ordered slice of the expanded input). It also doesn't
+ // make sense to expand things here anyway - use a loop in
+ // bash if you need that kind of control.
+ scripts, err := environment.SliceMapper(r.Script, fullEnv)
if err != nil {
return "", "", "", err
}