Close docker client (#789)

* Close docker client!

* Fix nil dereference

* Update run_context.go

* Bump

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2021-10-24 18:50:43 +02:00
committed by GitHub
parent f8ddfca6f7
commit 83a28d9512
7 changed files with 24 additions and 3 deletions

View File

@@ -231,7 +231,12 @@ func (rc *RunContext) Executor() common.Executor {
}
steps = append(steps, rc.stopJobContainer())
return common.NewPipelineExecutor(steps...).If(rc.isEnabled)
return common.NewPipelineExecutor(steps...).Finally(func(ctx context.Context) error {
if rc.JobContainer != nil {
return rc.JobContainer.Close()(ctx)
}
return nil
}).If(rc.isEnabled)
}
func (rc *RunContext) newStepExecutor(step *model.Step) common.Executor {