diff options
| author | Michal Arbet <michal.arbet@ultimum.io> | 2023-09-14 12:31:23 +0200 |
|---|---|---|
| committer | Michal Arbet <michal.arbet@ultimum.io> | 2023-09-14 12:31:23 +0200 |
| commit | 299f1d6bdd94018532ec27fad80830e8a8f1d4eb (patch) | |
| tree | 3cf476b641529627f060b8d3fc380cb4c3f466a0 | |
| parent | 64098b209cfab47b1cd23351c09e5de3ed275c46 (diff) | |
| download | kolla-299f1d6bdd94018532ec27fad80830e8a8f1d4eb.tar.gz kolla-299f1d6bdd94018532ec27fad80830e8a8f1d4eb.zip | |
Fix stderr logging when image build fail
Change-Id: Ie8730ae44cc26b87bd7eac93c8aac8dce8c7c5fc
| -rw-r--r-- | kolla/image/tasks.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kolla/image/tasks.py b/kolla/image/tasks.py index 27377a865..1fbfbd6b5 100644 --- a/kolla/image/tasks.py +++ b/kolla/image/tasks.py @@ -16,6 +16,7 @@ import os import shutil import tarfile +import docker.errors import git import requests from requests import exceptions as requests_exc @@ -391,10 +392,16 @@ class BuildTask(EngineTask): if image.status != Status.ERROR and self.conf.squash and \ self.conf.engine == engine.Engine.DOCKER.value: self.squash() - except engine.getEngineException(self.conf): + + except engine.getEngineException(self.conf) as e: image.status = Status.ERROR + if isinstance(e, docker.errors.BuildError): + for line in e.build_log: + if 'stream' in line: + self.logger.error(line['stream'].strip()) self.logger.exception('Unknown container engine ' 'error when building') + except Exception: image.status = Status.ERROR self.logger.exception('Unknown error when building') |
