We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e8e40a commit a216d3dCopy full SHA for a216d3d
internal/oci/oci.go
@@ -128,6 +128,7 @@ func (r *Runtime) WaitContainerStateStopped(ctx context.Context, c *Container) e
128
129
done := make(chan error, 1)
130
chControl := make(chan struct{}, 1)
131
+ defer close(chControl)
132
go func() {
133
defer close(done)
134
for {
@@ -152,10 +153,8 @@ func (r *Runtime) WaitContainerStateStopped(ctx context.Context, c *Container) e
152
153
case err = <-done:
154
break
155
case <-ctx.Done():
- close(chControl)
156
return ctx.Err()
157
case <-time.After(time.Duration(r.config.CtrStopTimeout) * time.Second):
158
159
return fmt.Errorf(
160
"failed to get container stopped status: %ds timeout reached",
161
r.config.CtrStopTimeout,
0 commit comments