Skip to content

CC-8364 Allow containers without imageName - #7307

Merged
ghostwriternr merged 2 commits into
cloudflare:mainfrom
ghostwriternr:fix/container-named-images-no-default
Sep 15, 2026
Merged

ghostwriternr merged 2 commits into
cloudflare:mainfrom
ghostwriternr:fix/container-named-images-no-default

Conversation

@ghostwriternr

@ghostwriternr ghostwriternr commented Sep 10, 2026

Copy link
Copy Markdown
Member

Container Apps have a namespace-level image. workerd models that as imageName, and currently requires it on every Container-enabled Durable Object namespace.

Container Instances do not have a namespace-level image. Worker code chooses the image on start(), and a full container snapshot is also a valid source. Local development cannot represent Instances today.

This change makes imageName optional. Namespaces that still set it keep no-argument start() behavior. Namespaces that omit it must pass an image or a full container snapshot to start(). Named images stay on ctx.container.images so Worker code can pass them to start(). They are not a replacement for imageName.

A full container snapshot replaces the image, so restore starts from the snapshot even when the namespace has a different imageName. Directory snapshots only overlay files, so they still need an image or full snapshot underneath.

Tests cover API validation, named-image and empty configurations, direct image selection, missing sources, directory snapshots as a non-source, and Docker-backed snapshot restore against a different imageName.

@ghostwriternr
ghostwriternr requested review from a team as code owners September 10, 2026 19:09
@ghostwriternr
ghostwriternr marked this pull request as draft September 10, 2026 19:16
@codecov-commenter

codecov-commenter commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 49.59350% with 124 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.41%. Comparing base (bc591a4) to head (12ead33).

Files with missing lines Patch % Lines
src/workerd/server/tests/container-client/test.js 0.00% 96 Missing ⚠️
src/workerd/server/container-client.c++ 24.00% 17 Missing and 2 partials ⚠️
src/workerd/api/container.c++ 50.00% 2 Missing and 3 partials ⚠️
src/workerd/server/server.c++ 57.14% 2 Missing and 1 partial ⚠️
src/workerd/api/container-test.c++ 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7307      +/-   ##
==========================================
+ Coverage   37.31%   37.41%   +0.10%     
==========================================
  Files         811      811              
  Lines      253974   254182     +208     
  Branches    20105    20110       +5     
==========================================
+ Hits        94776    95114     +338     
+ Misses     147788   147624     -164     
- Partials    11410    11444      +34     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghostwriternr
ghostwriternr force-pushed the fix/container-named-images-no-default branch from 70e749d to c212581 Compare September 10, 2026 21:28
@ghostwriternr ghostwriternr changed the title CC-8364 Allow containers without default images CC-8364 Allow containers without a default image Sep 11, 2026
@ghostwriternr
ghostwriternr force-pushed the fix/container-named-images-no-default branch 4 times, most recently from 797aa34 to a96c59f Compare September 11, 2026 09:59
@ghostwriternr ghostwriternr changed the title CC-8364 Allow containers without a default image CC-8364 Allow containers without imageName Sep 11, 2026
@ghostwriternr
ghostwriternr force-pushed the fix/container-named-images-no-default branch 2 times, most recently from b19b9c8 to a11d197 Compare September 11, 2026 11:21
Comment thread src/workerd/io/worker.h Outdated
Comment thread src/workerd/api/container.c++
@ghostwriternr
ghostwriternr force-pushed the fix/container-named-images-no-default branch 2 times, most recently from e1fa43e to 21c9e44 Compare September 11, 2026 17:37
Named-image Durable Objects select an image at start time. Workerd
required imageName on every Container-enabled namespace, which forced
local tooling to invent an image and diverge from production.

Make imageName optional. Namespaces that set it keep no-argument
start(). Namespaces that omit it must pass an image or a full container
snapshot. Named images stay on ctx.container.images; they are not a
replacement for imageName.
@ghostwriternr
ghostwriternr force-pushed the fix/container-named-images-no-default branch from 21c9e44 to 826ca8a Compare September 11, 2026 17:43
@ghostwriternr
ghostwriternr merged commit 980d3ce into cloudflare:main Sep 15, 2026
20 of 22 checks passed
@ghostwriternr
ghostwriternr deleted the fix/container-named-images-no-default branch September 15, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants