github_packages: write_index_json: add image.ref.name

This commit is contained in:
Shaun Jackman 2021-03-30 19:45:35 -07:00 committed by Mike McQuaid
parent d8a2cf9efc
commit bb7a3ce7e5
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -233,7 +233,8 @@ class GitHubPackages
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)
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)
# docker/skopeo insist on lowercase org ("repository name") # docker/skopeo insist on lowercase org ("repository name")
org_prefix = "#{DOCKER_PREFIX}#{org.downcase}" org_prefix = "#{DOCKER_PREFIX}#{org.downcase}"
@ -287,16 +288,15 @@ class GitHubPackages
write_hash(blobs, image_index) write_hash(blobs, image_index)
end end
def write_index_json(index_json_sha256, index_json_size, root) def write_index_json(index_json_sha256, index_json_size, root, annotations)
index_json = { index_json = {
schemaVersion: 2, schemaVersion: 2,
manifests: [{ manifests: [{
mediaType: "application/vnd.oci.image.index.v1+json", mediaType: "application/vnd.oci.image.index.v1+json",
digest: "sha256:#{index_json_sha256}", digest: "sha256:#{index_json_sha256}",
size: index_json_size, size: index_json_size,
annotations: {}, annotations: annotations,
}], }],
annotations: {},
} }
validate_schema!(IMAGE_INDEX_SCHEMA_URI, index_json) validate_schema!(IMAGE_INDEX_SCHEMA_URI, index_json)
write_hash(root, index_json, "index.json") write_hash(root, index_json, "index.json")