deprecate reference package, migrate to github.com/distribution/reference
This integrates the new module, which was extracted from this repository at commitb9b19409cf
; # install filter-repo (https://github.com/newren/git-filter-repo/blob/main/INSTALL.md) brew install git-filter-repo # create a temporary clone of docker cd ~/Projects git clone https://github.com/distribution/distribution.git reference cd reference # commit taken from git rev-parse --verify HEADb9b19409cf
# remove all code, except for general files, 'reference/', and rename to / git filter-repo \ --path .github/workflows/codeql-analysis.yml \ --path .github/workflows/fossa.yml \ --path .golangci.yml \ --path distribution-logo.svg \ --path CODE-OF-CONDUCT.md \ --path CONTRIBUTING.md \ --path GOVERNANCE.md \ --path README.md \ --path LICENSE \ --path MAINTAINERS \ --path-glob 'reference/*.*' \ --path-rename reference/: # initialize go.mod go mod init github.com/distribution/reference go mod tidy -go=1.20 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b9b19409cf
commit
152af63ec5
65 changed files with 921 additions and 2454 deletions
39
reference/normalize_deprecated.go
Normal file
39
reference/normalize_deprecated.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package reference
|
||||
|
||||
import (
|
||||
"github.com/distribution/reference"
|
||||
)
|
||||
|
||||
// ParseNormalizedNamed parses a string into a named reference
|
||||
// transforming a familiar name from Docker UI to a fully
|
||||
// qualified reference. If the value may be an identifier
|
||||
// use ParseAnyReference.
|
||||
//
|
||||
// Deprecated: use [reference.ParseNormalizedNamed].
|
||||
func ParseNormalizedNamed(s string) (reference.Named, error) {
|
||||
return reference.ParseNormalizedNamed(s)
|
||||
}
|
||||
|
||||
// ParseDockerRef normalizes the image reference following the docker convention,
|
||||
// which allows for references to contain both a tag and a digest.
|
||||
//
|
||||
// Deprecated: use [reference.ParseDockerRef].
|
||||
func ParseDockerRef(ref string) (reference.Named, error) {
|
||||
return reference.ParseDockerRef(ref)
|
||||
}
|
||||
|
||||
// TagNameOnly adds the default tag "latest" to a reference if it only has
|
||||
// a repo name.
|
||||
//
|
||||
// Deprecated: use [reference.TagNameOnly].
|
||||
func TagNameOnly(ref reference.Named) reference.Named {
|
||||
return reference.TagNameOnly(ref)
|
||||
}
|
||||
|
||||
// ParseAnyReference parses a reference string as a possible identifier,
|
||||
// full digest, or familiar name.
|
||||
//
|
||||
// Deprecated: use [reference.ParseAnyReference].
|
||||
func ParseAnyReference(ref string) (reference.Reference, error) {
|
||||
return reference.ParseAnyReference(ref)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue