(conn context.Context, s *specgen.SpecGenerator)
| 49 | } |
| 50 | |
| 51 | func 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 | |
| 65 | func waitAndRemoveContainer(conn context.Context, ID string) error { |
| 66 | _, err := containers.Wait(conn, ID, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{stopped})) |
no outgoing calls
no test coverage detected