mirror of
https://github.com/distribution/distribution.git
synced 2025-09-25 22:23:38 +00:00
Add tag delete API
Signed-off-by: João Pereira <484633+joaodrp@users.noreply.github.com>
This commit is contained in:
@@ -112,16 +112,7 @@ func (ts *tagStore) Untag(ctx context.Context, tag string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
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
|
||||
return ts.blobStore.driver.Delete(ctx, tagPath)
|
||||
}
|
||||
|
||||
// linkedBlobStore returns the linkedBlobStore for the named tag, allowing one
|
||||
|
@@ -98,8 +98,8 @@ func TestTagStoreUnTag(t *testing.T) {
|
||||
desc := distribution.Descriptor{Digest: "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}
|
||||
|
||||
err := tags.Untag(ctx, "latest")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
if err == nil {
|
||||
t.Error("expected error removing unknown tag")
|
||||
}
|
||||
|
||||
err = tags.Tag(ctx, "latest", desc)
|
||||
|
Reference in New Issue
Block a user