diff --git a/modules/templates/util_string.go b/modules/templates/util_string.go index 2ae27d0833..382e2de13f 100644 --- a/modules/templates/util_string.go +++ b/modules/templates/util_string.go @@ -60,3 +60,7 @@ func (su *StringUtils) EllipsisString(s string, maxLength int) string { func (su *StringUtils) ToUpper(s string) string { return strings.ToUpper(s) } + +func (su *StringUtils) TrimPrefix(s, prefix string) string { + return strings.TrimPrefix(s, prefix) +} diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index aaed25bfbd..207774bfef 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -36,11 +36,13 @@ {{range .PackageDescriptor.Metadata.Manifests}} - - {{.Digest}} - {{.Platform}} - {{FileSize .Size}} - + {{if ne .Platform "unknown/unknown"}} + + {{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}} + {{.Platform}} + {{FileSize .Size}} + + {{end}} {{end}}