mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
fix: ImageSummary should have author information (#976)
Signed-off-by: Ana-Roberta Lisca <ana.kagome@yahoo.com>
This commit is contained in:
committed by
GitHub
parent
97e7f7f756
commit
5eeba938ab
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user