diff --git a/central/imagev2/datastore/store/postgres/store.go b/central/imagev2/datastore/store/postgres/store.go index e5d7b044a9b8f..f40c4155f66de 100644 --- a/central/imagev2/datastore/store/postgres/store.go +++ b/central/imagev2/datastore/store/postgres/store.go @@ -985,7 +985,7 @@ func (s *storeImpl) GetListImagesView(ctx context.Context, q *v1.Query) ([]*view selects := []*v1.QuerySelect{ search.NewQuerySelect(search.ImageSHA).Proto(), search.NewQuerySelect(search.ImageName).Proto(), - search.NewQuerySelect(search.ComponentCount).Proto(), + search.NewQuerySelect(search.ImageComponentCount).Proto(), search.NewQuerySelect(search.ImageCVECount).Proto(), search.NewQuerySelect(search.FixableCVECount).Proto(), search.NewQuerySelect(search.ImageCreatedTime).Proto(), diff --git a/central/imagev2/views/list_image_view.go b/central/imagev2/views/list_image_view.go index 82c328fa8bf91..2be005fd8e474 100644 --- a/central/imagev2/views/list_image_view.go +++ b/central/imagev2/views/list_image_view.go @@ -12,7 +12,7 @@ import ( type ListImageV2View struct { Digest string `db:"image_sha"` Name string `db:"image"` - ComponentCount int32 `db:"component_count"` + ComponentCount int32 `db:"image_component_count"` CVECount int32 `db:"image_cve_count"` FixableCVECount int32 `db:"fixable_cve_count"` Created *time.Time `db:"image_created_time"` diff --git a/generated/storage/image_v2.pb.go b/generated/storage/image_v2.pb.go index 6c304fe896c3f..91c8fec274ec4 100644 --- a/generated/storage/image_v2.pb.go +++ b/generated/storage/image_v2.pb.go @@ -343,7 +343,7 @@ func (x *ListImageV2) GetPriority() int64 { type ImageV2_ScanStats struct { state protoimpl.MessageState `protogen:"open.v1"` // Caching component count to avoid re-calculating it by joining on the component table. - ComponentCount int32 `protobuf:"varint,1,opt,name=component_count,json=componentCount,proto3" json:"component_count,omitempty" search:"Component Count,hidden"` // @gotags: search:"Component Count,hidden" + ComponentCount int32 `protobuf:"varint,1,opt,name=component_count,json=componentCount,proto3" json:"component_count,omitempty" search:"Image Component Count,hidden"` // @gotags: search:"Image Component Count,hidden" // Caching cve count to avoid re-calculating it by joining on the cve table. CveCount int32 `protobuf:"varint,2,opt,name=cve_count,json=cveCount,proto3" json:"cve_count,omitempty" search:"Image CVE Count,hidden"` // @gotags: search:"Image CVE Count,hidden" // Caching fixable cve count to avoid re-calculating it by joining on the cve table. diff --git a/pkg/search/options.go b/pkg/search/options.go index fb4d931804b2c..1c2111f837397 100644 --- a/pkg/search/options.go +++ b/pkg/search/options.go @@ -97,6 +97,7 @@ var ( ImageUser = newFieldLabel("Image User") ImageCommand = newFieldLabel("Image Command") ImageCVECount = newFieldLabel("Image CVE Count") + ImageComponentCount = newFieldLabel("Image Component Count") ImageEntrypoint = newFieldLabel("Image Entrypoint") ImageLabel = newFieldLabel("Image Label") ImageVolumes = newFieldLabel("Image Volumes") diff --git a/proto/storage/image_v2.proto b/proto/storage/image_v2.proto index c3120d96e5185..65f4beca37dfd 100644 --- a/proto/storage/image_v2.proto +++ b/proto/storage/image_v2.proto @@ -22,7 +22,7 @@ message ImageV2 { message ScanStats { // Caching component count to avoid re-calculating it by joining on the component table. - int32 component_count = 1; // @gotags: search:"Component Count,hidden" + int32 component_count = 1; // @gotags: search:"Image Component Count,hidden" // Caching cve count to avoid re-calculating it by joining on the cve table. int32 cve_count = 2; // @gotags: search:"Image CVE Count,hidden"