feat(search): update search pattern matching rules (#1257)

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
LaurentiuNiculae
2023-03-22 19:31:53 +02:00
committed by GitHub
parent fb85c8678c
commit f8a77bc42f
14 changed files with 83 additions and 264 deletions
+6 -6
View File
@@ -3150,7 +3150,7 @@ func TestGlobalSearchImageAuthor(t *testing.T) {
Repos {
Name LastUpdated Size
Platforms { Os Arch }
Vendors Score
Vendors
NewestImage {
RepoName Tag LastUpdated Size IsSigned
Authors
@@ -3213,7 +3213,7 @@ func TestGlobalSearchImageAuthor(t *testing.T) {
Repos {
Name LastUpdated Size
Platforms { Os Arch }
Vendors Score
Vendors
NewestImage {
RepoName Tag LastUpdated Size IsSigned
Authors
@@ -3427,7 +3427,7 @@ func TestGlobalSearch(t *testing.T) {
Repos {
Name LastUpdated Size
Platforms { Os Arch }
Vendors Score
Vendors
NewestImage {
RepoName Tag LastUpdated Size
Manifests{
@@ -3516,7 +3516,7 @@ func TestGlobalSearch(t *testing.T) {
Repos {
Name LastUpdated Size
Platforms { Os Arch }
Vendors Score
Vendors
NewestImage {
RepoName Tag LastUpdated Size
Manifests {
@@ -3753,7 +3753,7 @@ func TestGlobalSearch(t *testing.T) {
Repos {
Name LastUpdated Size
Platforms { Os Arch }
Vendors Score
Vendors
NewestImage {
RepoName Tag LastUpdated Size
Manifests {
@@ -3843,7 +3843,7 @@ func TestGlobalSearch(t *testing.T) {
Repos {
Name LastUpdated Size
Platforms { Os Arch }
Vendors Score
Vendors
NewestImage {
RepoName Tag LastUpdated Size
Manifests {
-2
View File
@@ -15,7 +15,6 @@ type RepoSummary struct {
Size string `json:"size"`
Platforms []Platform `json:"platforms"`
Vendors []string `json:"vendors"`
Score int `json:"score"`
NewestImage ImageSummary `json:"newestImage"`
}
@@ -33,7 +32,6 @@ type ImageSummary struct {
Licenses string `json:"licenses"`
Labels string `json:"labels"`
Title string `json:"title"`
Score int `json:"score"`
Source string `json:"source"`
Documentation string `json:"documentation"`
Authors string `json:"authors"`
@@ -482,7 +482,6 @@ func (olu BaseOciLayoutUtils) GetExpandedRepoInfo(repoName string) (RepoInfo, er
manifestDigest := man.Digest.String()
configDigest := manifest.Config.Digest.String()
lastUpdated := GetImageLastUpdated(imageConfigInfo)
score := 0
imageSummary := ImageSummary{
RepoName: repoName,
@@ -501,7 +500,6 @@ func (olu BaseOciLayoutUtils) GetExpandedRepoInfo(repoName string) (RepoInfo, er
LastUpdated: lastUpdated,
IsSigned: isSigned,
Size: size,
Score: score,
Description: annotations.Description,
Title: annotations.Title,
Documentation: annotations.Documentation,
@@ -546,7 +544,6 @@ func (olu BaseOciLayoutUtils) GetExpandedRepoInfo(repoName string) (RepoInfo, er
Platforms: repoPlatforms,
NewestImage: lastUpdatedImageSummary,
Vendors: repoVendors,
Score: -1,
}
repo.Summary = summary