aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-04-02 11:53:37 +0200
committerGitHub <noreply@github.com>2023-04-02 17:53:37 +0800
commitfbd4eaceed801e7400ed04a9dadedaf3a25dccb9 (patch)
tree9c25636fbfa755702b77f781147a096e5eafd309 /modules
parentf5593d08dc6d615e650fe5e954b300d1895212b7 (diff)
downloadgitea-fbd4eaceed801e7400ed04a9dadedaf3a25dccb9.tar.gz
gitea-fbd4eaceed801e7400ed04a9dadedaf3a25dccb9.zip
Display image size for multiarch container images (#23821)
Fixes #23771 Changes the display of different architectures for multiarch images to show the image size: ![grafik](https://user-images.githubusercontent.com/1666336/228781477-cc76c4d1-4728-434f-8a27-fc008790d924.png)
Diffstat (limited to 'modules')
-rw-r--r--modules/packages/container/metadata.go8
-rw-r--r--modules/packages/container/metadata_test.go2
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/packages/container/metadata.go b/modules/packages/container/metadata.go
index 6f62ab6a54..2a41fb9105 100644
--- a/modules/packages/container/metadata.go
+++ b/modules/packages/container/metadata.go
@@ -62,7 +62,13 @@ type Metadata struct {
DocumentationURL string `json:"documentation_url,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
ImageLayers []string `json:"layer_creation,omitempty"`
- MultiArch map[string]string `json:"multiarch,omitempty"`
+ Manifests []*Manifest `json:"manifests,omitempty"`
+}
+
+type Manifest struct {
+ Platform string `json:"platform"`
+ Digest string `json:"digest"`
+ Size int64 `json:"size"`
}
// ParseImageConfig parses the metadata of an image config
diff --git a/modules/packages/container/metadata_test.go b/modules/packages/container/metadata_test.go
index 5d8d3abfae..48809f4c99 100644
--- a/modules/packages/container/metadata_test.go
+++ b/modules/packages/container/metadata_test.go
@@ -46,7 +46,7 @@ func TestParseImageConfig(t *testing.T) {
},
metadata.Labels,
)
- assert.Empty(t, metadata.MultiArch)
+ assert.Empty(t, metadata.Manifests)
configHelm := `{"description":"` + description + `", "home": "` + projectURL + `", "sources": ["` + repositoryURL + `"], "maintainers":[{"name":"` + author + `"}]}`