github.com/quay/claircore@v1.5.28/oracle/normalizeseverity.go (about)

     1  package oracle
     2  
     3  import "github.com/quay/claircore"
     4  
     5  const (
     6  	NA        = "N/A"
     7  	Low       = "LOW"
     8  	Moderate  = "MODERATE"
     9  	Important = "IMPORTANT"
    10  	Critical  = "CRITICAL"
    11  )
    12  
    13  func NormalizeSeverity(severity string) claircore.Severity {
    14  	switch severity {
    15  	case NA:
    16  		return claircore.Unknown
    17  	case Low:
    18  		return claircore.Low
    19  	case Moderate:
    20  		return claircore.Medium
    21  	case Important:
    22  		return claircore.High
    23  	case Critical:
    24  		return claircore.Critical
    25  	default:
    26  		return claircore.Unknown
    27  	}
    28  }