fix: return None from image_created_at when timestamp is absent
FROM-scratch images (commit_container output) and registry images built for reproducibility often omit the created field entirely. Both backends were calling die() in that case, crashing the cached-image quickstart before any container started. image_created_at now returns datetime | None — None when the field is absent or unparseable, die() only on real inspect failures (non-zero exit, malformed JSON). stale_checks in both backends skips the staleness check when None is returned. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -231,7 +231,11 @@ def stale_checks(plan: DockerBottlePlan) -> None:
|
||||
return
|
||||
committed = read_committed_image(plan.slug)
|
||||
if committed and docker_mod.image_exists(committed):
|
||||
check_stale(f"agent image {committed!r}", docker_mod.image_created_at(committed))
|
||||
ts = docker_mod.image_created_at(committed)
|
||||
if ts is not None:
|
||||
check_stale(f"agent image {committed!r}", ts)
|
||||
return
|
||||
if docker_mod.image_exists(plan.image):
|
||||
check_stale(f"agent image {plan.image!r}", docker_mod.image_created_at(plan.image))
|
||||
ts = docker_mod.image_created_at(plan.image)
|
||||
if ts is not None:
|
||||
check_stale(f"agent image {plan.image!r}", ts)
|
||||
|
||||
Reference in New Issue
Block a user