fix: ImageSummary should have author information (#976)

Signed-off-by: Ana-Roberta Lisca <ana.kagome@yahoo.com>
This commit is contained in:
Lisca Ana-Roberta
2022-11-11 01:02:17 +02:00
committed by GitHub
parent 97e7f7f756
commit 5eeba938ab
7 changed files with 247 additions and 1 deletions
+14 -1
View File
@@ -167,6 +167,7 @@ type ImageAnnotations struct {
Source string
Labels string
Vendor string
Authors string
}
/*
@@ -195,6 +196,12 @@ func GetVendor(annotations map[string]string) string {
return GetAnnotationValue(annotations, ispec.AnnotationVendor, LabelAnnotationVendor)
}
func GetAuthors(annotations map[string]string) string {
authors := annotations[ispec.AnnotationAuthors]
return authors
}
func GetTitle(annotations map[string]string) string {
return GetAnnotationValue(annotations, ispec.AnnotationTitle, LabelAnnotationTitle)
}
@@ -232,7 +239,7 @@ func GetAnnotations(annotations, labels map[string]string) ImageAnnotations {
documentation := GetDocumentation(annotations)
if documentation == "" {
documentation = GetDocumentation(annotations)
documentation = GetDocumentation(labels)
}
source := GetSource(annotations)
@@ -255,6 +262,11 @@ func GetAnnotations(annotations, labels map[string]string) ImageAnnotations {
vendor = GetVendor(labels)
}
authors := GetAuthors(annotations)
if authors == "" {
authors = GetAuthors(labels)
}
return ImageAnnotations{
Description: description,
Title: title,
@@ -263,5 +275,6 @@ func GetAnnotations(annotations, labels map[string]string) ImageAnnotations {
Licenses: licenses,
Labels: categories,
Vendor: vendor,
Authors: authors,
}
}