Auto-generate annotation docs (#11831)

Co-authored-by: Ricardo Katz <ricardo.katz@gmail.com>
This commit is contained in:
k8s-infra-cherrypick-robot 2024-08-20 09:56:57 -07:00 committed by GitHub
parent d3bb2b4f87
commit c9e67ea9d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 407 additions and 53 deletions

View file

@ -210,6 +210,21 @@ func StringRiskToRisk(risk string) AnnotationRisk {
}
}
func (a AnnotationRisk) ToString() string {
switch a {
case AnnotationRiskCritical:
return "Critical"
case AnnotationRiskHigh:
return "High"
case AnnotationRiskMedium:
return "Medium"
case AnnotationRiskLow:
return "Low"
default:
return "Unknown"
}
}
func normalizeString(input string) string {
trimmedContent := []string{}
for _, line := range strings.Split(input, "\n") {