fixup! refactor(container): restart handling
This commit is contained in:
parent
7242534a10
commit
a74a2c7819
@ -243,6 +243,7 @@ func (a *Client) RunContainer(ctx context.Context, params RunContainerParams) (<
|
|||||||
|
|
||||||
a.runContainerLoop(
|
a.runContainerLoop(
|
||||||
ctx,
|
ctx,
|
||||||
|
cancel,
|
||||||
createResp.ID,
|
createResp.ID,
|
||||||
params.ContainerConfig.Image,
|
params.ContainerConfig.Image,
|
||||||
params.NetworkCountConfig,
|
params.NetworkCountConfig,
|
||||||
@ -329,6 +330,7 @@ func (a *Client) pullImageIfNeeded(ctx context.Context, imageName string, contai
|
|||||||
// when the container exits.
|
// when the container exits.
|
||||||
func (a *Client) runContainerLoop(
|
func (a *Client) runContainerLoop(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
|
cancel context.CancelFunc,
|
||||||
containerID string,
|
containerID string,
|
||||||
imageName string,
|
imageName string,
|
||||||
networkCountConfig NetworkCountConfig,
|
networkCountConfig NetworkCountConfig,
|
||||||
@ -336,6 +338,8 @@ func (a *Client) runContainerLoop(
|
|||||||
stateC chan<- domain.Container,
|
stateC chan<- domain.Container,
|
||||||
errC chan<- error,
|
errC chan<- error,
|
||||||
) {
|
) {
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
type containerWaitResponse struct {
|
type containerWaitResponse struct {
|
||||||
container.WaitResponse
|
container.WaitResponse
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user