Skip to content

Commit

Permalink
Merge pull request #7240 from jwhonce/issues/7123
Browse files Browse the repository at this point in the history
Default .Repository and .Tag values to <none>
  • Loading branch information
openshift-merge-robot authored Aug 10, 2020
2 parents f642b04 + c60b695 commit b20f44f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 13 additions & 5 deletions cmd/podman/images/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) {
} else {
h.ImageSummary = *e
h.Repository = "<none>"
h.Tag = "<none>"
imgs = append(imgs, h)
}
listFlag.readOnly = e.IsReadOnly()
Expand All @@ -205,27 +206,34 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) {
}

func tokenRepoTag(ref string) (string, string, error) {

if ref == "<none>:<none>" {
return "<none>", "<none>", nil
}

repo, err := reference.Parse(ref)
if err != nil {
return "", "", err
return "<none>", "<none>", err
}

named, ok := repo.(reference.Named)
if !ok {
return ref, "", nil
return ref, "<none>", nil
}
name := named.Name()
if name == "" {
name = "<none>"
}

tagged, ok := repo.(reference.Tagged)
if !ok {
return named.Name(), "", nil
return name, "<none>", nil
}
tag := tagged.Tag()
if tag == "" {
tag = "<none>"
}

return named.Name(), tagged.Tag(), nil
return name, tag, nil

}

Expand Down
2 changes: 0 additions & 2 deletions test/system/120-load.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ verify_iid_and_name() {


@test "podman load - by image ID" {
skip_if_remote "FIXME: pending #7123"

# FIXME: how to build a simple archive instead?
get_iid_and_name

Expand Down

0 comments on commit b20f44f

Please sign in to comment.