Skip to content

Commit

Permalink
Merge pull request #93 from TomasTomecek/fix-push
Browse files Browse the repository at this point in the history
push: use the image with metadata
  • Loading branch information
TomasTomecek authored Mar 18, 2019
2 parents 2bd49cd + 471899e commit 88d07dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ansible_bender/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def get_target_image_id(self):
"""
if self.state not in [BuildState.DONE, BuildState.FAILED]:
raise RuntimeError(f"Build have not finished yet, it is in state '{self.state.value}'.")
return self.get_top_layer_id()
return self.final_layer_id

def was_last_layer_cached(self):
if self.layers:
Expand Down
7 changes: 7 additions & 0 deletions tests/functional/test_buildah.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ def test_push_to_dockerd(target_image, tmpdir):
try:
cmd = ["docker", "run", "--rm", target, "cat", "/fun"]
subprocess.check_call(cmd)

docker_inspect = json.loads(subprocess.check_output(["docker", "inspect", target]))[0]
p_inspect = json.loads(subprocess.check_output(
["podman", "inspect", "-t", "image", target_image]))[0]
assert docker_inspect["RootFS"]["Layers"] == p_inspect["RootFS"]["Layers"]
assert docker_inspect["Created"] == p_inspect["Created"]
assert docker_inspect["Id"].endswith(p_inspect["Id"])
finally:
subprocess.check_call(["docker", "rmi", target])

Expand Down

0 comments on commit 88d07dd

Please sign in to comment.