registry/storage: ignore missing tag on delete
Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 1ba5b3b553
)
This commit is contained in:
parent
803ff0da68
commit
e22abf0fab
1 changed files with 11 additions and 8 deletions
|
@ -122,17 +122,20 @@ func (ts *tagStore) Untag(ctx context.Context, tag string) error {
|
||||||
name: ts.repository.Named().Name(),
|
name: ts.repository.Named().Name(),
|
||||||
tag: tag,
|
tag: tag,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
switch err.(type) {
|
|
||||||
case storagedriver.PathNotFoundError:
|
|
||||||
return distribution.ErrTagUnknown{Tag: tag}
|
|
||||||
case nil:
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return ts.blobStore.driver.Delete(ctx, tagPath)
|
if err := ts.blobStore.driver.Delete(ctx, tagPath); err != nil {
|
||||||
|
switch err.(type) {
|
||||||
|
case storagedriver.PathNotFoundError:
|
||||||
|
return nil // Untag is idempotent, we don't care if it didn't exist
|
||||||
|
default:
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// linkedBlobStore returns the linkedBlobStore for the named tag, allowing one
|
// linkedBlobStore returns the linkedBlobStore for the named tag, allowing one
|
||||||
|
|
Loading…
Reference in a new issue