Skip to content

Commit 69262ba

Browse files
committed
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 8c041a1 commit 69262ba

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/cmd-push-container-manifest

+11-5
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] = {
126-
'image': args.repo,
127-
'digest': manifest['digest'],
128-
'tags': args.tags
129-
}
125+
image = {
126+
'image': args.repo,
127+
'digest': manifest['digest'],
128+
'tags': args.tags
129+
}
130+
if buildmetas[arch].get(args.metajsonname, 'null') != 'null':
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

0 commit comments

Comments
 (0)