Skip to content

Commit

Permalink
fix(manager): base image count on correct distinct of columns
Browse files Browse the repository at this point in the history
  • Loading branch information
jdobes committed May 21, 2024
1 parent 5f1cb8d commit 3227143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manager/controllers/cves/cves.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (c *Controller) BuildCvesQuery(accountID int64, clusterIDs []string) *gorm.
cntSubquery := c.Conn.Table("cluster").
Select(`image_cve.cve_id,
COUNT(DISTINCT cluster_image.cluster_id) AS ce,
COUNT(cluster_image.image_id) AS ie`).
COUNT(DISTINCT(repository_image.repository_id, repository_image.image_id)) AS ie`).
Joins("JOIN cluster_image ON cluster.id = cluster_image.cluster_id").
Joins("JOIN image_cve ON cluster_image.image_id = image_cve.image_id").
Joins("JOIN repository_image ON cluster_image.image_id = repository_image.image_id").
Expand Down

0 comments on commit 3227143

Please sign in to comment.