fix(cloudflare): reuse unchanged container image digests - #1282
Merged
sam-goodwin merged 8 commits intoAug 23, 2026
Conversation
danieljvdm
marked this pull request as draft
August 21, 2026 05:20
danieljvdm
marked this pull request as ready for review
August 21, 2026 05:34
Contributor
|
Are there any regression tests we can add to exercise this? |
…ating a new container version Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e registry manifest probe Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop the docker push stdout scrape + PushDigestMissing fallback; the registry manifest probe is the single digest source for every image path, so every build test exercises it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e-create digest reuse Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cloudflare container applications now resolve pushed tags to immutable registry digests and persist both the digest and a fingerprint of the complete desired application configuration.
A changed source hash can still produce the same registry manifest. When that happens, the provider preserves the live image reference and returns before
updateContainerApplicationwhen the desired scaling, placement, and runtime configuration fingerprint is also unchanged. A changed image digest or application configuration still follows the normal update and rollout path.This is the default reconciliation behavior rather than an opt-in: an apply with no effective desired-state change should not create a new application version. Persisting the desired-state fingerprint avoids comparing against Cloudflare-enriched response defaults and ensures that removing a previously configured field is still recognized as a real change. Existing state without the fingerprint migrates conservatively through one normal update.
The digest has a single source: after a push (or for a pre-pushed tag) the provider asks the registry —
HEAD /v2/<repo>/manifests/<tag>with the minted pull credentials — rather than scrapingdocker pushoutput. A reference that already carries@sha256:…is used as-is.Regression tests
All in
ContainerApplication.test.ts, against the real registry and API:identical image re-push — the same remote image under two references changes the source hash but not the manifest; the live image and version must not change, and a genuinely different tag must roll out:
Without the fix the second deploy swaps the live image to the freshly pushed
:<sourceHash>tag and creates a rollout.pre-pushed tag reference — a consumer referencing the pushed
<repo>:<sourceHash>tag resolves to the same digest reference as one referencing<repo>@sha256:…(exercises the registry probe directly).legacy state migration — the row is rewritten to a pre-digest shape (
hash.imageonly, live image rolled back onto the tag); the next drift deploy keeps the tag reference, persists the digest + fingerprint through one update, and every later drift is a noop.Durable Object re-create — the live app is replaced out-of-band by a same-name app without the DO attachment (what precreate leaves behind) with a staled source hash; the re-create path rebuilds, matches the digest, and attaches the DO without changing the image reference.