1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

fix:Add Missing Severity Cases in SeverityFromString Function (#7974)

Signed-off-by: lichanghao.orange <lichanghao.orange@bytedance.com>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
UgOrange 2023-08-07 18:51:49 +08:00 committed by GitHub
parent 41b46159f0
commit 7415c1a3d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,12 +71,16 @@ func toPolicyResult(status engineapi.RuleStatus) policyreportv1alpha2.PolicyResu
func SeverityFromString(severity string) policyreportv1alpha2.PolicySeverity {
switch severity {
case policyreportv1alpha2.SeverityCritical:
return policyreportv1alpha2.SeverityCritical
case policyreportv1alpha2.SeverityHigh:
return policyreportv1alpha2.SeverityHigh
case policyreportv1alpha2.SeverityMedium:
return policyreportv1alpha2.SeverityMedium
case policyreportv1alpha2.SeverityLow:
return policyreportv1alpha2.SeverityLow
case policyreportv1alpha2.SeverityInfo:
return policyreportv1alpha2.SeverityInfo
}
return ""
}