mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Deprecate repo:shortid syntax
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
2fd674a00f
commit
5fc71599a0
2 changed files with 16 additions and 4 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/builder"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/pkg/stringid"
|
||||
"github.com/docker/docker/reference"
|
||||
)
|
||||
|
||||
|
@ -34,11 +35,15 @@ func (daemon *Daemon) GetImageID(refOrID string) (image.ID, error) {
|
|||
if id, err := daemon.referenceStore.Get(ref); err == nil {
|
||||
return image.IDFromDigest(id), nil
|
||||
}
|
||||
|
||||
// deprecated: repo:shortid https://github.com/docker/docker/pull/799
|
||||
if tagged, ok := ref.(reference.NamedTagged); ok {
|
||||
if id, err := daemon.imageStore.Search(tagged.Tag()); err == nil {
|
||||
for _, namedRef := range daemon.referenceStore.References(id.Digest()) {
|
||||
if namedRef.Name() == ref.Name() {
|
||||
return id, nil
|
||||
if tag := tagged.Tag(); stringid.IsShortID(stringid.TruncateID(tag)) {
|
||||
if id, err := daemon.imageStore.Search(tag); err == nil {
|
||||
for _, namedRef := range daemon.referenceStore.References(id.Digest()) {
|
||||
if namedRef.Name() == ref.Name() {
|
||||
return id, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,13 @@ To learn more about Docker Engine's deprecation policy,
|
|||
see [Feature Deprecation Policy](index.md#feature-deprecation-policy).
|
||||
|
||||
|
||||
### `repository:shortid` image references
|
||||
**Deprecated In Release: [v1.13](https://github.com/docker/docker/releases/)**
|
||||
|
||||
**Target For Removal In Release: v1.16**
|
||||
|
||||
`repository:shortid` syntax for referencing images is very little used, collides with with tag references can be confused with digest references.
|
||||
|
||||
### `docker daemon` subcommand
|
||||
**Deprecated In Release: [v1.13](https://github.com/docker/docker/releases/)**
|
||||
|
||||
|
|
Loading…
Reference in a new issue