Skip to content

Commit

Permalink
Merge pull request #1289 from vrothberg/catalog
Browse files Browse the repository at this point in the history
search: catalog: return full match as first item
  • Loading branch information
mtrmac authored Jul 13, 2021
2 parents 5a7aad2 + c031c43 commit 7f15918
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docker/docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,14 @@ func SearchRegistry(ctx context.Context, sys *types.SystemContext, registry, ima
res := SearchResult{
Name: repo,
}
searchRes = append(searchRes, res)
// bugzilla.redhat.com/show_bug.cgi?id=1976283
// If we have a full match, make sure it's listed as the first result.
// (Note there might be a full match we never see if we reach the result limit first.)
if repo == image {
searchRes = append([]SearchResult{res}, searchRes...)
} else {
searchRes = append(searchRes, res)
}
}
}

Expand Down

0 comments on commit 7f15918

Please sign in to comment.