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

Function createAndStartContainer

pkg/engine/container.go:51–63  ·  view source on GitHub ↗
(conn context.Context, s *specgen.SpecGenerator)

Source from the content-addressed store, hash-verified

49}
50
51func createAndStartContainer(conn context.Context, s *specgen.SpecGenerator) (entities.ContainerCreateResponse, error) {
52 createResponse, err := containers.CreateWithSpec(conn, s, nil)
53 if err != nil {
54 return createResponse, err
55 }
56
57 if err := containers.Start(conn, createResponse.ID, nil); err != nil {
58 return createResponse, err
59 }
60 klog.Infof("Container %s created.", s.Name)
61
62 return createResponse, nil
63}
64
65func waitAndRemoveContainer(conn context.Context, ID string) error {
66 _, err := containers.Wait(conn, ID, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{stopped}))

Callers 2

fileTransferPodmanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected