add comments

pull/11603/head
Ilya Zuyev 2021-06-25 13:28:29 -07:00
parent e910260883
commit 049c426dca
1 changed files with 3 additions and 0 deletions

View File

@ -180,6 +180,9 @@ func parseImage(img string) (*name.Tag, name.Reference, error) {
if !ok {
return nil, nil, errors.Wrap(err, "new ref")
}
// ErrBadName means img contains no digest
// It happens if its value is name:tag for example.
// In this case we want to give it a second chance and try to parse it one more time using name.NewTag(img)
tag, err := name.NewTag(img)
if err != nil {
return nil, nil, errors.Wrap(err, "new ref")