Skip to content

Commit 88d07dd

Browse files
authored
Merge pull request #93 from TomasTomecek/fix-push
push: use the image with metadata
2 parents 2bd49cd + 471899e commit 88d07dd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ansible_bender/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def get_target_image_id(self):
243243
"""
244244
if self.state not in [BuildState.DONE, BuildState.FAILED]:
245245
raise RuntimeError(f"Build have not finished yet, it is in state '{self.state.value}'.")
246-
return self.get_top_layer_id()
246+
return self.final_layer_id
247247

248248
def was_last_layer_cached(self):
249249
if self.layers:

tests/functional/test_buildah.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ def test_push_to_dockerd(target_image, tmpdir):
195195
try:
196196
cmd = ["docker", "run", "--rm", target, "cat", "/fun"]
197197
subprocess.check_call(cmd)
198+
199+
docker_inspect = json.loads(subprocess.check_output(["docker", "inspect", target]))[0]
200+
p_inspect = json.loads(subprocess.check_output(
201+
["podman", "inspect", "-t", "image", target_image]))[0]
202+
assert docker_inspect["RootFS"]["Layers"] == p_inspect["RootFS"]["Layers"]
203+
assert docker_inspect["Created"] == p_inspect["Created"]
204+
assert docker_inspect["Id"].endswith(p_inspect["Id"])
198205
finally:
199206
subprocess.check_call(["docker", "rmi", target])
200207

0 commit comments

Comments
 (0)