fix(sandbox): simplify docker image check
Simplify the stderr check in `dockerImageExists` to only look for "No such image", as requested in code review.
This commit is contained in:
committed by
Peter Steinberger
parent
49c6d8019f
commit
f58ad7625f
@@ -52,11 +52,7 @@ async function dockerImageExists(image: string) {
|
|||||||
});
|
});
|
||||||
if (result.code === 0) return true;
|
if (result.code === 0) return true;
|
||||||
const stderr = result.stderr.trim();
|
const stderr = result.stderr.trim();
|
||||||
if (
|
if (stderr.includes("No such image")) {
|
||||||
stderr.includes("No such image") ||
|
|
||||||
stderr.includes("No such object") ||
|
|
||||||
stderr.includes("not found")
|
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
throw new Error(`Failed to inspect sandbox image: ${stderr}`);
|
throw new Error(`Failed to inspect sandbox image: ${stderr}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user