Skip to content

Commit

Permalink
Merge pull request #140 from vijeyash1/main
Browse files Browse the repository at this point in the history
minor fix
  • Loading branch information
vijeyash1 authored Aug 2, 2023
2 parents 8f88320 + e55c995 commit 5553a7e
Showing 2 changed files with 7 additions and 13 deletions.
12 changes: 6 additions & 6 deletions client/pkg/clickhouse/db_client.go
Original file line number Diff line number Diff line change
@@ -364,12 +364,12 @@ func (c *DBClient) InsertTrivyImageMetrics(metrics model.TrivyImage) {
metrics.ID,
metrics.ClusterName,
metrics.Report.ArtifactName,
metrics.Report.Metadata.Size,
metrics.Report.Metadata.OS.Name,
metrics.Report.Metadata.ImageID,
strings.Join(metrics.Report.Metadata.DiffIDs, ","),
strings.Join(metrics.Report.Metadata.RepoTags, ","),
strings.Join(metrics.Report.Metadata.RepoDigests, ","),
// metrics.Report.Metadata.Size,
// metrics.Report.Metadata.OS.Name,
// metrics.Report.Metadata.ImageID,
// strings.Join(metrics.Report.Metadata.DiffIDs, ","),
// strings.Join(metrics.Report.Metadata.RepoTags, ","),
// strings.Join(metrics.Report.Metadata.RepoDigests, ","),
vulnerability.VulnerabilityID,
vulnerability.PkgID,
vulnerability.PkgName,
8 changes: 1 addition & 7 deletions client/pkg/clickhouse/statements.go
Original file line number Diff line number Diff line change
@@ -124,12 +124,6 @@ const trivyTableImage DBStatement = `
id UUID,
cluster_name String,
artifact_name String,
metadata_size BIGINT,
metadata_osname String,
metadata_imageid String,
metadata_diffid String,
metadata_repotags String,
metadata_repodigest String,
vul_id String,
vul_pkg_id String,
vul_pkg_name String,
@@ -164,5 +158,5 @@ const containerDockerhubTable DBStatement = `CREATE table IF NOT EXISTS containe
const containerGithubTable DBStatement = `CREATE table IF NOT EXISTS container_github(event JSON) ENGINE = MergeTree ORDER BY tuple();`
const InsertKubeScore string = "INSERT INTO kubescore (id, namespace, cluster_name, recommendations) VALUES (?, ?, ?, ?)"
const InsertTrivyVul string = "INSERT INTO trivy_vul (id, cluster_name, namespace, kind, name, vul_id, vul_vendor_ids, vul_pkg_id, vul_pkg_name, vul_pkg_path, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?. ?)"
const InsertTrivyImage string = "INSERT INTO trivyimage (id, cluster_name, artifact_name,metadata_size ,metadata_osname ,metadata_imageid ,metadata_diffid ,metadata_repotags ,metadata_repodigest, vul_id, vul_pkg_id, vul_pkg_name, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date) VALUES ( ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?)"
const InsertTrivyImage string = "INSERT INTO trivyimage (id, cluster_name, artifact_name, vul_id, vul_pkg_id, vul_pkg_name, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date) VALUES ( ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
const InsertTrivyMisconfig string = "INSERT INTO trivy_misconfig (id, cluster_name, namespace, kind, name, misconfig_id, misconfig_avdid, misconfig_type, misconfig_title, misconfig_desc, misconfig_msg, misconfig_query, misconfig_resolution, misconfig_severity, misconfig_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?. ?, ?)"

0 comments on commit 5553a7e

Please sign in to comment.