Skip to content

Commit

Permalink
fix: check if container is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Sep 27, 2024
1 parent f52460d commit 2dc6f94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ func (c *EtcdContainer) Terminate(ctx context.Context) error {
}
}

if err := c.Container.Terminate(ctx); err != nil {
errs = append(errs, fmt.Errorf("terminate cluster node: %w", err))
if c.Container != nil {
if err := c.Container.Terminate(ctx); err != nil {
errs = append(errs, fmt.Errorf("terminate cluster node: %w", err))
}
}

// remove the cluster network if it was created, but only for the first node
Expand Down

0 comments on commit 2dc6f94

Please sign in to comment.