mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-22 14:52:17 +01:00
Merge pull request #4777 from reasonerjt/fix-clair-sev
Fix mis-interpretation of severity in Clair
This commit is contained in:
commit
54d6b08e7c
@ -29,6 +29,7 @@ const (
|
||||
SeverityLow = "low"
|
||||
SeverityMedium = "medium"
|
||||
SeverityHigh = "high"
|
||||
SeverityCritical = "critical"
|
||||
)
|
||||
|
||||
// ProjectMetadata holds the metadata of a project.
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user