perf(doctor): run checks concurrently and share docker lookups (#32)

This commit is contained in:
Hector Ventura authored and GitHub committed 2026-10-08 21:28:58 -05:00
1 parent 3c4118ff1a
commit dd38f6dc27
20 files changed
+623 -51

No files matched your search

@@ -85,6 +85,18 @@ public class DockerClient {
}
}
/** The value of label {@code key} on a local image, empty when the label or image is missing. */
public Optional<String> imageLabel(String image, String key) throws DockerException {
try {
String out = run("docker", "inspect", "--format",
"{{index .Config.Labels \"" + key + "\"}}", image);
String value = out.trim();
return value.isEmpty() || "<no value>".equals(value) ? Optional.empty() : Optional.of(value);
} catch (DockerException e) {
return Optional.empty();
}
}
public void pull(String image, String policy) throws DockerException {
if ("never".equalsIgnoreCase(policy)) return;
if ("missing".equalsIgnoreCase(policy) && isImagePresent(image)) return;