Skip to content

Commit

Permalink
fix removing provider container error
Browse files Browse the repository at this point in the history
Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan committed May 16, 2024
1 parent 0f878a7 commit acc644a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,8 @@ func (a *analyzeCommand) RmVolumes(ctx context.Context) error {
func (a *analyzeCommand) RmProviderContainers(ctx context.Context) error {
for i := range a.providerContainerNames {
con := a.providerContainerNames[i]
// because we are using the --rm option when we start the provider container,
// it will immediately be removed after it stops
cmd := exec.CommandContext(
ctx,
Settings.PodmanBinary,
Expand All @@ -1285,13 +1287,6 @@ func (a *analyzeCommand) RmProviderContainers(ctx context.Context) error {
"container", con)
continue
}
a.log.V(1).Info("removing container", "container", con)
err = exec.CommandContext(ctx, Settings.PodmanBinary, "rm", con).Run()
if err != nil {
a.log.V(1).Error(err, "failed to remove container",
"container", con)
continue
}
}
return nil
}
Expand Down

0 comments on commit acc644a

Please sign in to comment.