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

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