Skip to content

Commit

Permalink
chore: fix red CI (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle authored Mar 17, 2023
1 parent 0df31ab commit bf81df6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions oci/pull.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ def _oci_pull_impl(rctx):
fail("Unrecognized mediaType {} in manifest file".format(image_mf["mediaType"]))

image_config_file = _trim_hash_algorithm(image_mf["config"]["digest"])
image_config = _download(rctx, image_mf["config"]["digest"], image_config_file)
_download(rctx, image_mf["config"]["digest"], image_config_file)

# FIXME: hardcoding this to fix CI, but where does the value come from?
index_media_type = "application/vnd.oci.image.index.v1+json"
tars = []
for layer in image_mf["layers"]:
hash = _trim_hash_algorithm(layer["digest"])
Expand All @@ -184,6 +187,7 @@ def _oci_pull_impl(rctx):
index_mf = """\
{
"schemaVersion": 2,
"mediaType": "%s",
"manifests": [
{
"mediaType": "%s",
Expand All @@ -195,19 +199,20 @@ def _oci_pull_impl(rctx):
}
}
]
}""" % (image_mf["mediaType"], image_mf_len, image_digest, arch, os)
}""" % (index_media_type, image_mf["mediaType"], image_mf_len, image_digest, arch, os)
else:
index_mf = """\
{
"schemaVersion": 2,
"mediaType": "%s",
"manifests": [
{
"mediaType": "%s",
"size": %s,
"digest": "%s"
}
]
}""" % (image_mf["mediaType"], image_mf_len, image_digest)
}""" % (index_media_type, image_mf["mediaType"], image_mf_len, image_digest)

rctx.file("BUILD.bazel", content = _build_file.format(
name = rctx.attr.name,
Expand Down

0 comments on commit bf81df6

Please sign in to comment.