(ctx context.Context)
| 2244 | } |
| 2245 | |
| 2246 | func (container *Container) ExitCode(ctx context.Context) (int, error) { |
| 2247 | contents, err := container.metaFileContents(ctx, engineutil.MetaMountExitCodePath) |
| 2248 | if err != nil { |
| 2249 | return 0, err |
| 2250 | } |
| 2251 | contents = strings.TrimSpace(contents) |
| 2252 | |
| 2253 | code, err := strconv.ParseInt(contents, 10, 64) |
| 2254 | if err != nil { |
| 2255 | return 0, fmt.Errorf("could not parse exit code %q: %w", contents, err) |
| 2256 | } |
| 2257 | |
| 2258 | return int(code), nil |
| 2259 | } |
| 2260 | |
| 2261 | func (container *Container) metaFileContents(ctx context.Context, filePath string) (string, error) { |
| 2262 | if err := container.Evaluate(ctx); err != nil { |
no test coverage detected