Skip to content

Commit bf81df6

Browse files
authored
chore: fix red CI (#110)
1 parent 0df31ab commit bf81df6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

oci/pull.bzl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ def _oci_pull_impl(rctx):
167167
fail("Unrecognized mediaType {} in manifest file".format(image_mf["mediaType"]))
168168

169169
image_config_file = _trim_hash_algorithm(image_mf["config"]["digest"])
170-
image_config = _download(rctx, image_mf["config"]["digest"], image_config_file)
170+
_download(rctx, image_mf["config"]["digest"], image_config_file)
171+
172+
# FIXME: hardcoding this to fix CI, but where does the value come from?
173+
index_media_type = "application/vnd.oci.image.index.v1+json"
171174
tars = []
172175
for layer in image_mf["layers"]:
173176
hash = _trim_hash_algorithm(layer["digest"])
@@ -184,6 +187,7 @@ def _oci_pull_impl(rctx):
184187
index_mf = """\
185188
{
186189
"schemaVersion": 2,
190+
"mediaType": "%s",
187191
"manifests": [
188192
{
189193
"mediaType": "%s",
@@ -195,19 +199,20 @@ def _oci_pull_impl(rctx):
195199
}
196200
}
197201
]
198-
}""" % (image_mf["mediaType"], image_mf_len, image_digest, arch, os)
202+
}""" % (index_media_type, image_mf["mediaType"], image_mf_len, image_digest, arch, os)
199203
else:
200204
index_mf = """\
201205
{
202206
"schemaVersion": 2,
207+
"mediaType": "%s",
203208
"manifests": [
204209
{
205210
"mediaType": "%s",
206211
"size": %s,
207212
"digest": "%s"
208213
}
209214
]
210-
}""" % (image_mf["mediaType"], image_mf_len, image_digest)
215+
}""" % (index_media_type, image_mf["mediaType"], image_mf_len, image_digest)
211216

212217
rctx.file("BUILD.bazel", content = _build_file.format(
213218
name = rctx.attr.name,

0 commit comments

Comments
 (0)