Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backend/druks/sandbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ async def acquire(
api = self._api()
try:
settings = load_settings()
image = image_override or settings.sandbox.image
if template:
# A template names its own image, built on the installation image.
image = None
else:
image = image_override or settings.sandbox.image
# drukbox reaps the host at lease end, so a dead worker still frees its VM.
expires_at = datetime.now(UTC) + timedelta(seconds=SANDBOX_HOST_LEASE_SECONDS)
try:
Expand Down
3 changes: 2 additions & 1 deletion backend/tests/test_sandbox_aws_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ async def test_acquire_persists_private_key_when_returned(
assert oct(os.stat(key_path).st_mode & 0o777) == "0o600"


async def test_acquire_passes_template_to_drukbox(
async def test_acquire_sends_a_template_without_the_installation_image(
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,
):
Expand All @@ -214,6 +214,7 @@ async def test_acquire_passes_template_to_drukbox(
pass

assert calls[0]["template"] == "template-1"
assert calls[0]["image"] is None


async def test_acquire_sends_no_template_by_default(
Expand Down
Loading