fix(firecracker): honor cached image policy

This commit is contained in:
2026-07-18 21:18:50 +00:00
committed by didericis
parent bd2674280e
commit 94bbfb3565
6 changed files with 114 additions and 20 deletions
+6 -5
View File
@@ -93,16 +93,17 @@ class FirecrackerBottleBackend(
)
def _build_or_load_images(self, plan: FirecrackerBottlePlan) -> BottleImages:
# Firecracker builds its rootfs image inside _launch_impl (via buildah in
# a builder VM), so there is nothing to pre-resolve here.
return BottleImages(agent=plan.image)
return BottleImages(agent=_launch.build_or_load_agent_base(plan))
def prelaunch_checks(self, plan: FirecrackerBottlePlan) -> None:
_launch.stale_checks(plan)
@contextmanager
def _launch_impl(
self, plan: FirecrackerBottlePlan, images: BottleImages,
) -> Generator[FirecrackerBottle, None, None]:
del images # rootfs built inside _launch.launch; images unused here
with _launch.launch(plan, provision=self.provision) as bottle:
assert isinstance(images.agent, Path)
with _launch.launch(plan, images.agent, provision=self.provision) as bottle:
yield bottle
def prepare_cleanup(self) -> FirecrackerBottleCleanupPlan: