diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-20 08:26:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 08:26:44 -0400 |
commit | 17f9b80600bc008e7c0a4060ff3a6bb5eb56d0cc (patch) | |
tree | 744e15183f75794ebe436d461334154a666b8dc0 /pkg | |
parent | b7b8fce82693ae0f9ebb0561cd3e6c118ad35fe9 (diff) | |
parent | 67a5e21bf84f44be182fd2a5aace4a17be226a84 (diff) | |
download | podman-17f9b80600bc008e7c0a4060ff3a6bb5eb56d0cc.tar.gz podman-17f9b80600bc008e7c0a4060ff3a6bb5eb56d0cc.tar.bz2 podman-17f9b80600bc008e7c0a4060ff3a6bb5eb56d0cc.zip |
Merge pull request #7018 from Luap99/fix#7015
fix: system df error when an image has no name
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/abi/system.go | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index bedd050ff..9727f1d4e 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -230,13 +230,18 @@ func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.System } } - named, err := reference.ParseNormalizedNamed(name) - if err != nil { - return nil, err - } - repository = named.Name() - if tagged, isTagged := named.(reference.NamedTagged); isTagged { - tag = tagged.Tag() + if len(name) > 0 { + named, err := reference.ParseNormalizedNamed(name) + if err != nil { + return nil, err + } + repository = named.Name() + if tagged, isTagged := named.(reference.NamedTagged); isTagged { + tag = tagged.Tag() + } + } else { + repository = "<none>" + tag = "<none>" } report := entities.SystemDfImageReport{ |