Skip to content

Commit 6851b5e

Browse files
committed
Drop pull_digest from hermetic boostrap image
Image has one Digest and many RepoDigests. So, we can hit situation when these two values don't match and podman will refuse to load such tarball later with error like described here: containers/podman#27323 We should move to different mechanism (porbably skopeo) in the near future.
1 parent 90f552e commit 6851b5e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mock/py/mock-hermetic-repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def prepare_image(image_specification, bootstrap_data, outputdir):
128128
Store the tarball into the same directory where the RPMs are
129129
"""
130130
pull_cmd = ["podman", "pull"]
131-
if "pull_digest" in bootstrap_data:
131+
if bootstrap_data.get("pull_digest"):
132132
image_specification += "@" + bootstrap_data["pull_digest"]
133133
if "architecture" in bootstrap_data:
134134
pull_cmd += ["--arch", bootstrap_data["architecture"]]

mock/py/mockbuild/podman.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,15 @@ def inspect_hermetic_metadata(self):
251251
"""
252252
Get the image metadata needed for the subsequent hermetic build.
253253
"""
254-
get_query = '{"pull_digest": "{{ .Digest }}", "id": "{{.Id}}", "architecture": "{{ .Architecture }}"}'
254+
get_query = '{"id": "{{.Id}}", "architecture": "{{ .Architecture }}"}'
255255
getLog().info("Reading image %s from %s", get_query, self.image)
256256
cmd = ["podman", "image", "inspect", "--format", get_query, self.image]
257257
res = subprocess.run(cmd, env=self.buildroot.env,
258258
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
259259
check=True)
260-
return json.loads(res.stdout.decode("utf-8").strip())
260+
res = json.loads(res.stdout.decode("utf-8").strip())
261+
res['pull_digest'] = None
262+
return res
261263

262264

263265
def __repr__(self):

0 commit comments

Comments
 (0)