Skip to content

Commit

Permalink
Fix removing provider container error (#235)
Browse files Browse the repository at this point in the history
fix removing provider container error

Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan authored May 21, 2024
1 parent dc6caf1 commit aa605e9
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 @@ -1378,6 +1378,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 @@ -1389,13 +1391,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 aa605e9

Please sign in to comment.