Skip to content

Commit d392ab2

Browse files
committedMar 20, 2025
cmd/push-container-manifest: use additional-images rather than overwrite
in coreos/fedora-coreos-pipeline#1091 we started publishing container images in multiples repos. However the build.json was not reflecting that, only storing the last pushed image data, overwriting it with each arch. See coreos#4038 See coreos/fedora-coreos-pipeline#1099
1 parent d20ee10 commit d392ab2

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
 

‎src/cmd-push-container-manifest

+7-1
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,17 @@ def main():
122122
arch = manifest['platform']['architecture']
123123
if arch in map_arch:
124124
arch = map_arch[arch]
125-
buildmetas[arch][args.metajsonname] = {
125+
image = {
126126
'image': args.repo,
127127
'digest': manifest['digest'],
128128
'tags': args.tags
129129
}
130+
if buildmetas[arch].get(args.metajsonname):
131+
additional_images = buildmetas[arch][args.metajsonname].get('additional-images', [])
132+
additional_images.append(image)
133+
buildmetas[arch][args.metajsonname]['additional-images'] = additional_images
134+
else:
135+
buildmetas[arch][args.metajsonname] = image
130136
buildmetas[arch].write(artifact_name=args.metajsonname)
131137

132138

‎src/v1.json

+31-1
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,41 @@
8787
},
8888
"primary-image": {
8989
"type": "object",
90-
"extends": "#/image",
90+
"required": [
91+
"image"
92+
],
9193
"optional": [
94+
"digest",
95+
"tags",
96+
"comment",
9297
"additional-images"
9398
],
9499
"properties": {
100+
"digest": {
101+
"$id": "#/image/digest",
102+
"type": "string",
103+
"title": "Digest"
104+
},
105+
"comment": {
106+
"$id": "#/image/comment",
107+
"type": "string",
108+
"title": "Comment"
109+
},
110+
"image": {
111+
"$id": "#/image/image",
112+
"type": "string",
113+
"title": "Image"
114+
},
115+
"tags": {
116+
"$id": "#/image/tags",
117+
"type": "array",
118+
"title": "Tags",
119+
"items": {
120+
"$id": "#/image/tags/item",
121+
"title": "Tag",
122+
"type": "string"
123+
}
124+
},
95125
"additional-images": {
96126
"$id": "#/image",
97127
"type": "array",

0 commit comments

Comments
 (0)
Please sign in to comment.