You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adapts upstream PR GoogleContainerTools#503 ("Add support for multi-arch image indexes") to
the fork. Upstream placed the index-selection logic inline in test.go,
but the fork's GoogleContainerTools#554 since centralized OCI-layout loading into
pkgutil.ImageFromOCILayout (shared by the Docker daemon path and the Tar
driver). The platform-based selection is added there instead, so both
drivers gain multi-arch support. ImageFromOCILayout now takes a platform
string; callers pass opts.Platform / args.Platform.
Two fork-authored changes beyond the upstream diff:
- Nil-platform guard: v1.Descriptor.Platform is a nil-able *v1.Platform
(OCI permits an index descriptor with no platform), and Satisfies has
a value receiver, so the upstream desc.Platform.Satisfies(...) call
panics with a nil dereference on such descriptors. findImageInIndex
now skips any descriptor whose Platform is nil. Covered by a unit test
that panics without the guard and passes with it.
- parsePlatform replaced with go-containerregistry's v1.ParsePlatform,
which accepts variants (e.g. linux/arm/v7) that the hand-rolled parser
rejected.
Also fixes the bundled shell test: numeric comparison uses -lt instead
of the string operator <, and the multi-arch temp dir no longer clobbers
the $tmp used by the following tar-driver test.
Co-authored-by: Joel Sing <jsing@canva.com>
Upstream-PR: GoogleContainerTools#503
0 commit comments