Skip to content

Replace ImageTarget.merge() with OrasMergeWorkflow#365

Merged
ianpittwood merged 7 commits intomainfrom
oras-oci-management-impl
Mar 12, 2026
Merged

Replace ImageTarget.merge() with OrasMergeWorkflow#365
ianpittwood merged 7 commits intomainfrom
oras-oci-management-impl

Conversation

@ianpittwood
Copy link
Contributor

@ianpittwood ianpittwood commented Feb 25, 2026

Summary

This PR refactors the multi-platform image merge functionality to use the ORAS CLI instead of Docker's buildx imagetools create with a temporary registry container.

Key changes:

  • Move merge orchestration to BakeryConfig: The merge() method on ImageTarget has been removed and replaced with merge_targets() on BakeryConfig. This centralizes merge operations and improves error handling across all targets.

  • Use OrasMergeWorkflow instead of Docker workaround: The previous implementation required spinning up a temporary Docker registry container to work around authentication issues with docker buildx imagetools create. The new ORAS-based workflow is cleaner and more efficient:

    1. Creates a temporary manifest index from source images
    2. Copies the index to all destination tags
    3. Cleans up the temporary index
  • Add plain_http support to ORAS commands: All ORAS commands now support the --plain-http flag for local/insecure registry testing.

  • Make get_merge_sources() public: Renamed from _get_merge_sources() since it's now used by OrasMergeWorkflow.

  • Reorganize test helpers: Moved test helpers into a proper package structure (test/helpers/).

Test plan

  • Existing merge tests updated and passing
  • ORAS workflow tests cover create, copy, delete operations
  • Tests verify plain_http flag propagation
  • Run just test to verify all tests pass

🤖 Generated with Claude Code

@ianpittwood ianpittwood marked this pull request as draft February 25, 2026 22:27
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Test Results

1 180 tests   1 180 ✅  13m 31s ⏱️
    1 suites      0 💤
    1 files        0 ❌

Results for commit cb0d628.

♻️ This comment has been updated with latest results.

@ianpittwood ianpittwood force-pushed the oras-oci-management-impl branch from a984a21 to 0389bef Compare February 26, 2026 15:17
@ianpittwood ianpittwood changed the title Oras oci management impl Replace ImageTarget.merge() with OrasMergeWorkflow Feb 26, 2026
@ianpittwood ianpittwood marked this pull request as ready for review March 2, 2026 15:26
@ianpittwood ianpittwood force-pushed the oras-oci-management-impl branch from 4947ca1 to 9dd55b8 Compare March 3, 2026 18:19
Base automatically changed from oras-oci-management to main March 3, 2026 18:25
@ianpittwood ianpittwood force-pushed the oras-oci-management-impl branch from bced671 to 8328a71 Compare March 10, 2026 20:56
Copy link
Contributor

@bschwedler bschwedler left a comment

Choose a reason for hiding this comment

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

I am happy merging as long as multi-platform builds are successful.

ianpittwood and others added 7 commits March 11, 2026 13:47
Refactor the merge() method to use ORAS CLI instead of Docker's buildx
imagetools with a local registry workaround. This simplifies the merge
workflow and removes the dependency on spawning a local registry container.

Key changes:
- Add temp_registry property to ImageTarget for convenient access
- Add plain_http flag to ORAS commands for local HTTP registry support
- Refactor merge() to use OrasMergeWorkflow for both dry-run and actual merge
- Move RegistryContainer from production code to test helpers
- Update CLI error handling to catch BakeryError and ValueError
- Update unit tests to mock OrasMergeWorkflow instead of Docker operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate multi-platform merge handling in BakeryConfig.merge_targets()
instead of having each ImageTarget handle its own merge. This provides
better error handling and cleaner separation of concerns. Also make
get_merge_sources() a public method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ianpittwood ianpittwood force-pushed the oras-oci-management-impl branch from 8328a71 to cb0d628 Compare March 11, 2026 19:47
@ianpittwood ianpittwood added this pull request to the merge queue Mar 11, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 11, 2026
Replace ImageTarget.merge() with OrasMergeWorkflow
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2026
@ianpittwood ianpittwood added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit a12ba50 Mar 12, 2026
14 checks passed
@ianpittwood ianpittwood deleted the oras-oci-management-impl branch March 12, 2026 14:20
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.

2 participants