dockerRuntimes returns the list of container runtimes available on the host. It does this by running `docker info` and parsing the output.
(t *testing.T)
| 149 | // dockerRuntimes returns the list of container runtimes available on the host. |
| 150 | // It does this by running `docker info` and parsing the output. |
| 151 | func dockerRuntimes(t *testing.T) []string { |
| 152 | t.Helper() |
| 153 | |
| 154 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 155 | defer cancel() |
| 156 | |
| 157 | cmd := exec.CommandContext(ctx, "docker", "info", "--format", "{{ range $k, $v := .Runtimes}}{{ println $k }}{{ end }}") |
| 158 | out, err := cmd.CombinedOutput() |
| 159 | require.NoError(t, err, "failed to get docker runtimes: %s", out) |
| 160 | raw := strings.TrimSpace(string(out)) |
| 161 | return strings.Split(raw, "\n") |
| 162 | } |
| 163 | |
| 164 | // outerFiles returns the list of files in the outer container matching the |
| 165 | // given pattern. It does this by running `ls -1` in the outer container. |
no test coverage detected