mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
fix: convert severity from negligible to none before saving to db (#15791)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
2679b2427b
commit
b390112f5a
@ -6,3 +6,6 @@ ALTER TABLE replication_policy ADD COLUMN IF NOT EXISTS speed_kb int;
|
|||||||
/* add version fields for lock free quota */
|
/* add version fields for lock free quota */
|
||||||
ALTER TABLE quota ADD COLUMN IF NOT EXISTS version bigint DEFAULT 0;
|
ALTER TABLE quota ADD COLUMN IF NOT EXISTS version bigint DEFAULT 0;
|
||||||
ALTER TABLE quota_usage ADD COLUMN IF NOT EXISTS version bigint DEFAULT 0;
|
ALTER TABLE quota_usage ADD COLUMN IF NOT EXISTS version bigint DEFAULT 0;
|
||||||
|
|
||||||
|
/* convert Negligible to None for the severity of the vulnerability record */
|
||||||
|
UPDATE vulnerability_record SET severity='None' WHERE severity='Negligible';
|
||||||
|
@ -104,6 +104,7 @@ func (c *nativeToRelationalSchemaConverter) toSchema(ctx context.Context, report
|
|||||||
|
|
||||||
var cveIDs []interface{}
|
var cveIDs []interface{}
|
||||||
for _, v := range vulnReport.Vulnerabilities {
|
for _, v := range vulnReport.Vulnerabilities {
|
||||||
|
v.Severity = vuln.ParseSeverityVersion3(v.Severity.String())
|
||||||
cveIDs = append(cveIDs, v.ID)
|
cveIDs = append(cveIDs, v.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user