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:
@@ -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 {
|
||||
|
@@ -332,7 +332,7 @@ func (sc *StepContext) runUsesContainer() common.Executor {
|
||||
stepContainer.Start(true),
|
||||
).Finally(
|
||||
stepContainer.Remove().IfBool(!rc.Config.ReuseContainers),
|
||||
)(ctx)
|
||||
).Finally(stepContainer.Close())(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,7 +589,7 @@ func (sc *StepContext) execAsDocker(ctx context.Context, action *model.Action, a
|
||||
stepContainer.Start(true),
|
||||
).Finally(
|
||||
stepContainer.Remove().IfBool(!rc.Config.ReuseContainers),
|
||||
)(ctx)
|
||||
).Finally(stepContainer.Close())(ctx)
|
||||
}
|
||||
|
||||
func (sc *StepContext) execAsComposite(ctx context.Context, step *model.Step, _ string, rc *RunContext, containerActionDir string, actionName string, _ string, action *model.Action, maybeCopyToActionDir func() error) error {
|
||||
|
Reference in New Issue
Block a user