Skip to content

Commit f5a7497

Browse files
author
saville
committed
Handle docker image not found errors
1 parent 8c1ed5d commit f5a7497

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

buildrunner/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ def run(self): # pylint: disable=too-many-statements,too-many-branches,too-many
472472
)
473473
else:
474474
self.log.write("\nPush not requested\n")
475+
475476
except requests.exceptions.ConnectionError as rce:
476477
print(str(rce))
477478
exit_explanation = (
@@ -481,6 +482,9 @@ def run(self): # pylint: disable=too-many-statements,too-many-branches,too-many
481482
"remote PyPi server information is set correctly."
482483
)
483484
self.exit_code = 1
485+
except ImageNotFound as inf:
486+
exit_explanation = f"Image not found: {inf.explanation}"
487+
self.exit_code = os.EX_CONFIG
484488
except BuildRunnerError as exc:
485489
exit_explanation = str(exc)
486490
self.exit_code = (

tests/test-files/test-docker-pull-failure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
steps:
33
use-bogus-image:
44
run:
5-
image: user1/buildrunner-test-multi-platform:bogus
5+
image: user1/buildrunner-bogus-image:bogus
66
cmd: echo "Hello World"

0 commit comments

Comments
 (0)