Skip to content

cg160: ocilayout warmer#307

Merged
mzihlmann merged 3 commits intomainfrom
cg160-ocilayout-warmer
Jan 6, 2026
Merged

cg160: ocilayout warmer#307
mzihlmann merged 3 commits intomainfrom
cg160-ocilayout-warmer

Conversation

@mzihlmann
Copy link
Collaborator

Fixes # in case of a bug fix, this should point to a bug and any other related issue(s)

Description

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Describe any changes here so maintainer can include it in the release notes, or delete this block.

Examples of user facing changes:
- kaniko adds a new flag `--registry-repo` to override registry

@mzihlmann mzihlmann force-pushed the cg160-ocilayout-warmer branch 2 times, most recently from 43e5c9b to b520aa4 Compare October 22, 2025 05:18
@mzihlmann
Copy link
Collaborator Author

good now, but lacks integration tests

@mzihlmann mzihlmann force-pushed the cg160-ocilayout-warmer branch 2 times, most recently from 2958d9b to efe3e5f Compare October 23, 2025 04:12
@mzihlmann
Copy link
Collaborator Author

currently builds on top of #321, let's get the other in first.

@mzihlmann mzihlmann force-pushed the cg160-ocilayout-warmer branch 4 times, most recently from fd3cb57 to 1150beb Compare October 23, 2025 05:52
@mzihlmann mzihlmann marked this pull request as ready for review October 23, 2025 15:36
@mzihlmann
Copy link
Collaborator Author

integration tests dont work locally anymore after activating this, simply because a subdir in integration/cache and integration/tmpCache gets created that can't be walked by go test.

@babs babs requested a review from Copilot November 4, 2025 08:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the Kaniko image caching mechanism to properly handle OCI image layouts and digest-based cache lookups. It adds a new OCI warmer feature behind a feature flag that stores cached images in OCI layout format rather than tarballs, and fixes cache lookup logic to correctly handle the distinction between image manifests and image indexes.

Key changes:

  • Improved cache lookup logic to handle digest references that may point to either image manifests or image indexes
  • Added OCI-based warmer implementation behind FF_KANIKO_OCI_WARMER feature flag
  • Added integration tests for the new warmer functionality

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/image/image_util.go Enhanced cache lookup to attempt local cache first for digest references, with fallback to remote lookup for image-index cases
pkg/cache/warm.go Added OciWarmer struct and ociWarmToFile function to support OCI layout caching
pkg/cache/cache.go Added ociCachedImageFromPath to read images from OCI layout directories
integration/integration_test.go Added TestWarmer and manifestDiff tests, refactored helper functions
integration/images.go Added warmer test infrastructure, updated base image references, added buildWarmerImage method
integration/dockerfiles/Dockerfile_test_issue_mz320 New test Dockerfile for testing image-manifest vs image-index cache behavior

@mzihlmann mzihlmann force-pushed the cg160-ocilayout-warmer branch 5 times, most recently from 3ca47c6 to b99686b Compare November 7, 2025 05:20
@mzihlmann mzihlmann force-pushed the cg160-ocilayout-warmer branch from 9f4021a to 969db97 Compare November 13, 2025 06:18
@mzihlmann mzihlmann force-pushed the cg160-ocilayout-warmer branch 2 times, most recently from b5ac265 to c9d56e8 Compare November 27, 2025 08:20
@mzihlmann mzihlmann force-pushed the cg160-ocilayout-warmer branch from c9d56e8 to 3165c3b Compare December 3, 2025 13:21
Copy link
Collaborator

@0hlov3 0hlov3 left a comment

Choose a reason for hiding this comment

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

LGTM.

@mzihlmann mzihlmann merged commit 36e5eeb into main Jan 6, 2026
12 checks passed
@mzihlmann
Copy link
Collaborator Author

just noticed this misses the readme docs for FF_KANIKO_OCI_WARMER

@mzihlmann mzihlmann deleted the cg160-ocilayout-warmer branch January 6, 2026 22:52
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.

3 participants