diff --git a/src/common/models/pro_meta.go b/src/common/models/pro_meta.go index bb54a99e9..82cc88155 100644 --- a/src/common/models/pro_meta.go +++ b/src/common/models/pro_meta.go @@ -29,6 +29,7 @@ const ( SeverityLow = "low" SeverityMedium = "medium" SeverityHigh = "high" + SeverityCritical = "critical" ) // ProjectMetadata holds the metadata of a project. diff --git a/src/common/utils/clair/utils.go b/src/common/utils/clair/utils.go index be3152fae..80348834d 100644 --- a/src/common/utils/clair/utils.go +++ b/src/common/utils/clair/utils.go @@ -15,10 +15,10 @@ package clair import ( + "fmt" "github.com/vmware/harbor/src/common/dao" "github.com/vmware/harbor/src/common/models" "github.com/vmware/harbor/src/common/utils/log" - "fmt" "strings" ) @@ -34,7 +34,7 @@ func ParseClairSev(clairSev string) models.Severity { return models.SevLow case models.SeverityMedium: return models.SevMedium - case models.SeverityHigh: + case models.SeverityHigh, models.SeverityCritical: return models.SevHigh default: return models.SevUnknown diff --git a/src/common/utils/clair/utils_test.go b/src/common/utils/clair/utils_test.go index 2775561d1..bda4701b0 100644 --- a/src/common/utils/clair/utils_test.go +++ b/src/common/utils/clair/utils_test.go @@ -32,6 +32,7 @@ func TestParseServerity(t *testing.T) { "LOW": models.SevLow, "Medium": models.SevMedium, "high": models.SevHigh, + "Critical": models.SevHigh, } for k, v := range in { assert.Equal(v, ParseClairSev(k))