Merge pull request #3718 from QiWang19/df_imgindex

fix system df crashes on unnamed images
This commit is contained in:
OpenShift Merge Robot
2019-08-05 16:37:01 +02:00
committed by GitHub

View File

@ -460,11 +460,11 @@ func getImageVerboseDiskUsage(ctx context.Context, images []*image.Image, images
} }
var repo string var repo string
var tag string var tag string
if len(img.Names()) == 0 { var repotags []string
repo = "<none>" if len(img.Names()) != 0 {
tag = "<none>" repotags = []string{img.Names()[0]}
} }
repopairs, err := image.ReposToMap([]string{img.Names()[0]}) repopairs, err := image.ReposToMap(repotags)
if err != nil { if err != nil {
logrus.Errorf("error finding tag/digest for %s", img.ID()) logrus.Errorf("error finding tag/digest for %s", img.ID())
} }