Skip to content

feat(tar driver): add OCI layout tar driver support#554

Open
malt3 wants to merge 1 commit intoGoogleContainerTools:mainfrom
malt3:publish-tar_driver_support_oci_layout
Open

feat(tar driver): add OCI layout tar driver support#554
malt3 wants to merge 1 commit intoGoogleContainerTools:mainfrom
malt3:publish-tar_driver_support_oci_layout

Conversation

@malt3
Copy link
Copy Markdown
Contributor

@malt3 malt3 commented Apr 13, 2026

Add support for OCI layout with tar driver:

  • Extend tar driver to handle OCI layout directories directly
  • Add OCILayout field to DriverConfig for tar driver configuration
  • Implement imageFromOCILayout function to load images from OCI layout
  • Add ImageFromV1 utility function to create Image from v1.Image
  • Update --image-from-oci-layout to support both Docker and Tar drivers

Add test coverage:

  • Add Ubuntu 22.04 tar test configurations for amd64, arm64, ppc64le, and s390x architectures
  • Add test case for OCI layout with tar driver in test script

Closes #461

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for OCI layouts when using the Tar driver. It updates the CLI to accept the --image-from-oci-layout flag for both Docker and Tar drivers, introduces a new ImageFromV1 utility for filesystem extraction, and implements OCI layout handling within the TarDriver. Additionally, several architecture-specific test configurations and a new integration test case were included. Review feedback identifies a bug in a logrus.Fatalf call where a format argument is missing, suggests refactoring duplicated OCI layout logic into a shared utility, and points out a potential directory leak in ImageFromV1 if filesystem extraction fails.

Comment thread cmd/container-structure-test/app/cmd/test.go
Comment thread pkg/drivers/tar_driver.go
Comment thread internal/pkgutil/image_utils.go
Add support for OCI layout with tar driver:
- Extend tar driver to handle OCI layout directories directly
- Add OCILayout field to DriverConfig for tar driver configuration
- Implement imageFromOCILayout function to load images from OCI layout
- Add ImageFromV1 utility function to create Image from v1.Image
- Update --image-from-oci-layout to support both Docker and Tar drivers

Add test coverage:
- Add Ubuntu 22.04 tar test configurations for amd64, arm64, ppc64le,
  and s390x architectures
- Add test case for OCI layout with tar driver in test script

Closes GoogleContainerTools#461
@malt3 malt3 force-pushed the publish-tar_driver_support_oci_layout branch from f42988b to 23e375c Compare April 13, 2026 14:44
@alexeagle
Copy link
Copy Markdown
Collaborator

@loosebazooka could you TAL when you get a few minutes? 🙏🏻

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.

Bazel: support tar driver for oci_image

2 participants