MCPcopy Create free account
hub / github.com/containers/fetchit / waitAndRemoveContainer

Function waitAndRemoveContainer

pkg/engine/container.go:65–81  ·  view source on GitHub ↗
(conn context.Context, ID string)

Source from the content-addressed store, hash-verified

63}
64
65func waitAndRemoveContainer(conn context.Context, ID string) error {
66 _, err := containers.Wait(conn, ID, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{stopped}))
67 if err != nil {
68 return err
69 }
70
71 _, err = containers.Remove(conn, ID, new(containers.RemoveOptions).WithForce(true))
72 if err != nil {
73 // There's a podman bug somewhere that's causing this
74 if err.Error() == "unexpected end of JSON input" {
75 return nil
76 }
77 return err
78 }
79
80 return nil
81}
82
83func convertMounts(mounts []mount) []specs.Mount {
84 result := []specs.Mount{}

Callers 3

fileTransferPodmanFunction · 0.85
ansiblePodmanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected