c8d/push: Return error when repository has no tags
In case of `docker push -a`, we need to return an error if there is no image for the given repository. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
f44b085da6
commit
cd95cd0671
1 changed files with 4 additions and 0 deletions
|
@ -53,6 +53,10 @@ func (i *ImageService) PushImage(ctx context.Context, sourceRef reference.Named,
|
|||
return err
|
||||
}
|
||||
|
||||
if len(imgs) == 0 {
|
||||
return fmt.Errorf("An image does not exist locally with the tag: %s", reference.FamiliarName(sourceRef))
|
||||
}
|
||||
|
||||
for _, img := range imgs {
|
||||
named, err := reference.ParseNamed(img.Name)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue