fix 99: support string and map variants of container

This commit is contained in:
Casey Lee
2020-02-24 22:35:08 -08:00
parent dadf8918be
commit 51b6167606
5 changed files with 63 additions and 5 deletions

View File

@@ -87,8 +87,9 @@ func (sc *StepContext) setupEnv() common.Executor {
step := sc.Step
return func(ctx context.Context) error {
var env map[string]string
if job.Container != nil {
env = mergeMaps(rc.GetEnv(), job.Container.Env, step.GetEnv())
c := job.Container()
if c != nil {
env = mergeMaps(rc.GetEnv(), c.Env, step.GetEnv())
} else {
env = mergeMaps(rc.GetEnv(), step.GetEnv())
}