distribution/manifest
Sebastiaan van Stijn f1c8c41408
Descriptor: do not implement Describable interface
Commit cb6f002350 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
2ff77c00ba.

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
- Updates ManifestBuilder interface and implementations to accept a
  `Descriptor`.

After this patch, the caller is responsible for changing a describable
type into a descriptor;

    builder.AppendReference(describable.Descriptor())

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-16 11:30:53 +02:00
..
manifestlist Fix Go Idioms 2023-04-21 15:22:37 +01:00
ocischema Descriptor: do not implement Describable interface 2024-07-16 11:30:53 +02:00
schema2 Descriptor: do not implement Describable interface 2024-07-16 11:30:53 +02:00
doc.go Move manifest package to schema1 2015-08-21 16:29:47 -07:00
versioned.go manifest: versioned: fix typo 2016-07-19 13:54:41 +02:00