Skip to content

Commit

Permalink
Handle docker image not found errors
Browse files Browse the repository at this point in the history
  • Loading branch information
saville committed Nov 21, 2024
1 parent 8c1ed5d commit f5a7497
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions buildrunner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ def run(self): # pylint: disable=too-many-statements,too-many-branches,too-many
)
else:
self.log.write("\nPush not requested\n")

except requests.exceptions.ConnectionError as rce:
print(str(rce))
exit_explanation = (
Expand All @@ -481,6 +482,9 @@ def run(self): # pylint: disable=too-many-statements,too-many-branches,too-many
"remote PyPi server information is set correctly."
)
self.exit_code = 1
except ImageNotFound as inf:
exit_explanation = f"Image not found: {inf.explanation}"
self.exit_code = os.EX_CONFIG
except BuildRunnerError as exc:
exit_explanation = str(exc)
self.exit_code = (
Expand Down
2 changes: 1 addition & 1 deletion tests/test-files/test-docker-pull-failure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
steps:
use-bogus-image:
run:
image: user1/buildrunner-test-multi-platform:bogus
image: user1/buildrunner-bogus-image:bogus
cmd: echo "Hello World"

0 comments on commit f5a7497

Please sign in to comment.