Skip to content

Commit

Permalink
ignore 'kubectl logs job/kaniko-build-*' error
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavchenko committed Sep 4, 2023
1 parent 2d83846 commit 2252ba4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions nb2workflow/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,15 @@ def _build_with_kaniko(git_origin,
if job_status[0].type == 'Complete':
break
if job_status[0].type == 'Failed':
buildlog = sp.check_output([
'kubectl',
'logs',
f"job/kaniko-build-{suffix}"
])
try:
buildlog = sp.check_output([
'kubectl',
'logs',
f"job/kaniko-build-{suffix}"
])
except sp.CalledProcessError:
buildlog = None
logger.error('Error getting buildlog from %s', f"job/kaniko-build-{suffix}")
raise ContainerBuildException('', buildlog)

finally:
Expand Down

0 comments on commit 2252ba4

Please sign in to comment.