Skip to content

Handle missing Docker-Content-Digest during manifest resolution#715

Open
praneethhere wants to merge 2 commits into
apple:mainfrom
praneethhere:fix/missing-docker-content-digest
Open

Handle missing Docker-Content-Digest during manifest resolution#715
praneethhere wants to merge 2 commits into
apple:mainfrom
praneethhere:fix/missing-docker-content-digest

Conversation

@praneethhere

Copy link
Copy Markdown

Fixes apple/container#1453

Some registries do not return Docker-Content-Digest on manifest HEAD responses. Previously, manifest resolution failed immediately when this header was missing.

This change updates manifest resolution to fall back to a GET request when Docker-Content-Digest is missing, then computes the sha256 digest from the returned manifest body. Existing HEAD-based behavior is preserved when the header is present.

Validation:

  • swift build --target ContainerizationOCI

Notes:

  • Full swift test is blocked locally by unrelated macOS 26 SDK vmnet symbols.
  • make pre-commit is blocked locally by existing swift-fmt parsing errors in ContainerizationExtras address files unrelated to this change.
@praneethhere praneethhere force-pushed the fix/missing-docker-content-digest branch from 3d98e41 to 76b6f0f Compare May 1, 2026 00:32
@praneethhere praneethhere force-pushed the fix/missing-docker-content-digest branch from 3fbadba to beae386 Compare May 1, 2026 00:45
@jimdigriz

jimdigriz commented Jun 12, 2026

Copy link
Copy Markdown

Misses the Push side

guard descriptor.digest == response.headers.first(name: "Docker-Content-Digest") else {
let required = response.headers.first(name: "Docker-Content-Digest") ?? ""
throw ContainerizationError(.internalError, message: "digest mismatch \(descriptor.digest) != \(required)")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants