(ContainerId id)
| 76 | } |
| 77 | |
| 78 | public Optional<ContainerInfo> inspect(ContainerId id) { |
| 79 | Require.nonNull("Container id", id); |
| 80 | |
| 81 | LOG.fine("Inspecting container with id: " + id); |
| 82 | |
| 83 | if (!getDocker().map(protocol -> protocol.isContainerPresent(id)).orElse(false)) { |
| 84 | return Optional.empty(); |
| 85 | } |
| 86 | |
| 87 | return Optional.of( |
| 88 | getDocker() |
| 89 | .map(protocol -> protocol.inspectContainer(id)) |
| 90 | .orElseThrow(() -> new DockerException("Unable to inspect container: " + id))); |
| 91 | } |
| 92 | |
| 93 | private Optional<DockerProtocol> getDocker() { |
| 94 | if (dockerClient.isPresent()) { |
no test coverage detected