The removeContainer function now accepts a struct

We had something like 6 different boolean options (removing a
container turns out to be rather complicated, because there are a
million-odd things that want to do it), and the function
signature was getting unreasonably large. Change to a struct to
clean things up.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon committed 2023-06-01 16:27:27 -04:00
1 parent 4e6efbbbb3
commit 2c9f18182a
6 files changed
+100 -26

No files matched your search

+7 -1
View File
@@ -143,7 +143,13 @@ func (r *Runtime) removeMalformedPod(ctx context.Context, p *Pod, ctrs []*Contai
ctrNamedVolumes[vol.Name] = vol
}
_, _, err := r.removeContainer(ctx, ctr, force, false, true, true, false, false, timeout)
opts := ctrRmOpts{
Force: force,
RemovePod: true,
IgnoreDeps: true,
Timeout: timeout,
}
_, _, err := r.removeContainer(ctx, ctr, opts)
return err
}()
removedCtrs[ctr.ID()] = err