github_packages: abort with an error if image index is >= 4MB

This commit is contained in:
Bo Anderson 2023-07-28 00:43:57 +01:00
parent e5346d8aac
commit 599f7af505
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -424,6 +424,7 @@ class GitHubPackages
end end
index_json_sha256, index_json_size = write_image_index(manifests, blobs, formula_annotations_hash) index_json_sha256, index_json_size = write_image_index(manifests, blobs, formula_annotations_hash)
raise "Image index too large!" if index_json_size >= 4 * 1024 * 1024 # GitHub will error 500 if too large
write_index_json(index_json_sha256, index_json_size, root, write_index_json(index_json_sha256, index_json_size, root,
"org.opencontainers.image.ref.name" => version_rebuild) "org.opencontainers.image.ref.name" => version_rebuild)