Files
moby/registry/types.go
Sebastiaan van Stijn 08654b0b30 registry: deprecate RepositoryInfo.Official field
This field indicates whether a repository is an official image (Docker
Library / Docker Official Images). This information is deducted from the
image reference, and not used anywhere, other than in tests.

The `RepositoryInfo` and `IndexInfo` types were originally introduced in
568f86eb18, with their fields documented in
4fcb9ac40c.

At the time, the `Official` field was only used for `docker push` to produce
a custom error message if someone would attempt to push an official image
to docker hub (assuming nobody would be able to do so);
6870bde584/api/client/commands.go (L1184-L1194)

Before that commit, the condition for this error message was based on the
given image reference directly; b370acd679
b370acd679/commands.go (L421-L428)

This patch deprecates the field, because it's not used, and removes
tests related to it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-03 10:12:17 +01:00

25 lines
909 B
Go

package registry // import "github.com/docker/docker/registry"
import (
"github.com/distribution/reference"
"github.com/docker/docker/api/types/registry"
)
// RepositoryInfo describes a repository
type RepositoryInfo struct {
Name reference.Named
// Index points to registry information
Index *registry.IndexInfo
// Official indicates whether the repository is considered official.
// If the registry is official, and the normalized name does not
// contain a '/' (e.g. "foo"), then it is considered an official repo.
//
// Deprecated: this field is no longer used and will be removed in the next release. The information captured in this field can be obtained from the [Name] field instead.
Official bool
// Class represents the class of the repository, such as "plugin"
// or "image".
//
// Deprecated: this field is no longer used, and will be removed in the next release.
Class string
}