Skip to content

Conversation

euanh
Copy link
Collaborator

@euanh euanh commented Apr 28, 2025

Motivation

ContainerRegistry methods follow the distribution API closely. containertool defines some extensions which build more convenient operations over these primitive functions. These extensions should accept ImageReference arguments. Currently they take separate repository and reference arguments and the caller needs to extract these fields from the appropriate references. This provides an opportunity for errors, such as trying to use the a reference with the wrong repository.

Modifications

getImageManifest(), getImageConfiguration() and putImageConfiguration() now accept ImageReference arguments.

Result

The caller no longer has to extract the underlying fields, and the risk of mixing them up is reduced.

Test Plan

All tests continue to pass.

@euanh euanh force-pushed the refactor/image-reference-arguments branch 2 times, most recently from 8bc1802 to 4949054 Compare April 28, 2025 10:01
@euanh euanh force-pushed the refactor/image-reference-arguments branch from 4949054 to a918851 Compare April 28, 2025 10:08
@euanh euanh added the semver/none No version bump required. label Apr 28, 2025
@euanh euanh merged commit d674ad3 into apple:main Apr 28, 2025
23 checks passed
@euanh euanh deleted the refactor/image-reference-arguments branch April 28, 2025 10:17
euanh added a commit to euanh/swift-container-plugin that referenced this pull request May 1, 2025
…geReference arguments (apple#114)

Motivation
----------

`ContainerRegistry` methods follow the distribution API closely.
`containertool` defines some extensions which build more convenient
operations over these primitive functions. These extensions should
accept `ImageReference` arguments. Currently they take separate
repository and reference arguments and the caller needs to extract these
fields from the appropriate references. This provides an opportunity for
errors, such as trying to use the a reference with the wrong repository.

Modifications
-------------

`getImageManifest()`, `getImageConfiguration()` and
`putImageConfiguration()` now accept `ImageReference` arguments.

Result
------

The caller no longer has to extract the underlying fields, and the risk
of mixing them up is reduced.

Test Plan
---------

All tests continue to pass.
@euanh euanh mentioned this pull request May 1, 2025
euanh added a commit that referenced this pull request May 1, 2025
…geReference arguments (#114)

Motivation
----------

`ContainerRegistry` methods follow the distribution API closely.
`containertool` defines some extensions which build more convenient
operations over these primitive functions. These extensions should
accept `ImageReference` arguments. Currently they take separate
repository and reference arguments and the caller needs to extract these
fields from the appropriate references. This provides an opportunity for
errors, such as trying to use the a reference with the wrong repository.

Modifications
-------------

`getImageManifest()`, `getImageConfiguration()` and
`putImageConfiguration()` now accept `ImageReference` arguments.

Result
------

The caller no longer has to extract the underlying fields, and the risk
of mixing them up is reduced.

Test Plan
---------

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

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant