Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Descriptor an alias for oci.Descriptor #3888

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

With the removal of the Describable interface from this type, and
deprecation of the Versioned type, the Descriptor is now an exact
equivalent of the oci.Descriptor.

This patch makes Descriptor an alias for oci.Descriptor.

Update the Manifest types to use the oci implementation of the Versioned
struct.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Commit cb6f002 implemented a generic
Manifest interface to represent manifests in the registry and remove
references to schema specific manifests.

As part of this refactor, the Describable interface was introduced,
which allowed for a single ManifestBuilder interface to handle both
schema1 and schema2 manifests. Implementations of Describable are
generally objects which can be described, not simply descriptors, but
for convenience, this interface was also implemented on Descriptor in
2ff77c0.

This interface served its purpose, but no longer needed for most cases;
schema2 (and OCI) descriptors do not need this method, making it only
needed for `schema1.Reference`, which is now deprecated.

Requiring this interface to be implemented limits interoperability
between distribution's Descriptor and the OCI Descriptor types, which
are identical in every other way, except for the presence of the
Describable interface.

This patch:

- Removes the `Descriptor.Descriptor()` method (no longer implementing
  the `Describable` interface).
- Updates ManifestBuilder interface and implementations to accept either
  a `Descriptor`, a `Describable`, or (for schema1), a `schema1.Reference`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
With the removal of the Describable interface from this type, and
deprecation of the Versioned type, the Descriptor is now an exact
equivalent of the oci.Descriptor.

This patch makes Descriptor an alias for oci.Descriptor.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.08 ⚠️

Comparison is base (29b5e79) 56.63% compared to head (6025946) 56.55%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3888      +/-   ##
==========================================
- Coverage   56.63%   56.55%   -0.08%     
==========================================
  Files         106      106              
  Lines       10674    10689      +15     
==========================================
  Hits         6045     6045              
- Misses       3955     3967      +12     
- Partials      674      677       +3     
Impacted Files Coverage Δ
manifest/schema1/manifest.go 33.82% <ø> (ø)
manifest/schema1/config_builder.go 69.63% <50.00%> (-2.03%) ⬇️
manifest/ocischema/builder.go 61.01% <58.33%> (-5.03%) ⬇️
manifest/schema2/builder.go 66.66% <58.33%> (-4.77%) ⬇️
manifest/manifestlist/manifestlist.go 70.90% <100.00%> (-0.52%) ⬇️
manifest/ocischema/manifest.go 74.19% <100.00%> (ø)
manifest/schema1/reference_builder.go 93.75% <100.00%> (-0.25%) ⬇️
manifest/schema2/manifest.go 80.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants