Skip to content

Commit

Permalink
acceptance: remove the volume ctn after the node containers
Browse files Browse the repository at this point in the history
(Since the latter depend on the former)

Also, this preserves the Nodes slice, so it can be inspected
with a debugger.

Release justification: non-production code changes

Release note: None
  • Loading branch information
knz committed Aug 25, 2022
1 parent aaab1c2 commit 64cda3d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/acceptance/cluster/dockercluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func CreateDocker(

func (l *DockerCluster) expectEvent(c *Container, msgs ...string) {
for index, ctr := range l.Nodes {
if c.id != ctr.id {
if ctr.Container == nil || c.id != ctr.id {
continue
}
for _, status := range msgs {
Expand Down Expand Up @@ -723,11 +723,6 @@ func (l *DockerCluster) stop(ctx context.Context) {
<-l.monitorDone
}

if l.vols != nil {
maybePanic(l.vols.Kill(ctx))
maybePanic(l.vols.Remove(ctx))
l.vols = nil
}
for i, n := range l.Nodes {
if n.Container == nil {
continue
Expand All @@ -750,8 +745,14 @@ func (l *DockerCluster) stop(ctx context.Context) {
log.Infof(ctx, "~~~ node %d CRASHED ~~~~", i)
}
maybePanic(n.Remove(ctx))
n.Container = nil
}

if l.vols != nil {
maybePanic(l.vols.Kill(ctx))
maybePanic(l.vols.Remove(ctx))
l.vols = nil
}
l.Nodes = nil

if l.networkID != "" {
maybePanic(
Expand Down

0 comments on commit 64cda3d

Please sign in to comment.