|
@@ -9,9 +9,11 @@ use super::shq;
|
|
|
async fn get_image_digest(config: &Config, node: &Node, image: &str) -> Result<Option<String>> {
|
|
async fn get_image_digest(config: &Config, node: &Node, image: &str) -> Result<Option<String>> {
|
|
|
// `docker image ls` does not accept digest refs (`repo@sha256:...`) —
|
|
// `docker image ls` does not accept digest refs (`repo@sha256:...`) —
|
|
|
// use `docker image inspect` for those; it also returns the image ID.
|
|
// use `docker image inspect` for those; it also returns the image ID.
|
|
|
|
|
+ // `|| true`: inspect exits 1 when the ref is absent (a peer that simply
|
|
|
|
|
+ // doesn't have it yet) — that is "no digest", not an ssh failure.
|
|
|
let cmd = if image.contains('@') {
|
|
let cmd = if image.contains('@') {
|
|
|
format!(
|
|
format!(
|
|
|
- "docker image inspect --format '{{{{.Id}}}}' {} 2>/dev/null",
|
|
|
|
|
|
|
+ "docker image inspect --format '{{{{.Id}}}}' {} 2>/dev/null || true",
|
|
|
shq(image)
|
|
shq(image)
|
|
|
)
|
|
)
|
|
|
} else {
|
|
} else {
|