(ctx context.Context, client Client, execID string)
| 96 | } |
| 97 | |
| 98 | func GetExecPID(ctx context.Context, client Client, execID string) (int, error) { |
| 99 | for r := retry.New(time.Second, time.Second); r.Wait(ctx); { |
| 100 | inspect, err := client.ContainerExecInspect(ctx, execID) |
| 101 | if err != nil { |
| 102 | return 0, xerrors.Errorf("exec inspect: %w", err) |
| 103 | } |
| 104 | |
| 105 | if inspect.Pid == 0 { |
| 106 | continue |
| 107 | } |
| 108 | return inspect.Pid, nil |
| 109 | } |
| 110 | |
| 111 | return 0, ctx.Err() |
| 112 | } |
| 113 | |
| 114 | func WaitForExit(ctx context.Context, client Client, execID string) error { |
| 115 | for r := retry.New(time.Second, time.Second); r.Wait(ctx); { |
no test coverage detected