apply feedback

Signed-off-by: João Pereira <484633+joaodrp@users.noreply.github.com>
This commit is contained in:
João Pereira 2021-06-06 19:53:34 +01:00
parent 81f081f91b
commit 033683d629
No known key found for this signature in database
GPG key ID: C325CA2B821F7043

View file

@ -492,13 +492,14 @@ func (imh *manifestHandler) DeleteManifest(w http.ResponseWriter, r *http.Reques
}
if imh.Tag != "" {
dcontext.GetLogger(imh).Debug("DeleteImageTag")
tagService := imh.Repository.Tags(imh.Context)
if err := tagService.Untag(imh.Context, imh.Tag); err != nil {
switch err.(type) {
case distribution.ErrTagUnknown, driver.PathNotFoundError:
imh.Errors = append(imh.Errors, v2.ErrorCodeManifestUnknown)
imh.Errors = append(imh.Errors, v2.ErrorCodeManifestUnknown.WithDetail(err))
default:
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnknown)
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
}
return
}