Skip to content

Commit

Permalink
Merge pull request #1191 from xiechengsheng/my_branch3
Browse files Browse the repository at this point in the history
bugfix: add default tag ":latest" when using pouch rmi to remove untagged container images.
  • Loading branch information
Wei Fu authored Apr 26, 2018
2 parents 669b77b + 9eb3177 commit dce981e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daemon/mgr/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (mgr *ImageManager) RemoveImage(ctx context.Context, image *types.ImageInfo
}
if refTagged, ok := refNamed.(reference.Tagged); ok {
ref = refTagged.String()
} else {
// add default tag ":latest" for image which is to be removed
defaultTaggedRef := reference.WithDefaultTagIfMissing(refNamed).(reference.Tagged)
ref = defaultTaggedRef.Name() + ":" + defaultTaggedRef.Tag()
}

if err := mgr.client.RemoveImage(ctx, ref); err != nil {
Expand Down

0 comments on commit dce981e

Please sign in to comment.