Add extra debug/profiling in buildah debug mode

Make this controled via the caller application --debug option.
Related-bug: #1901753
Depends-On: https://review.opendev.org/745357
Change-Id: Iece6c5b99cbc0bc8e3d2342ff17fbd727a3efe0e
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2020-11-12 19:16:39 +01:00
parent 8f50effd79
commit 817bff1059
2 changed files with 5 additions and 1 deletions

View File

@ -163,6 +163,9 @@ class BuildahBuilder(base.BaseBuilder):
bud_args = ['bud']
for v in self.volumes:
bud_args.extend(['--volume', v])
if self.debug:
# TODO(bogdando): add --log-rusage for newer buildah
bud_args.extend(['--loglevel=3'])
# TODO(aschultz): drop --format docker when oci format is properly
# supported by the undercloud registry
bud_args.extend(['--format', 'docker', '--tls-verify=False',

View File

@ -110,7 +110,8 @@ class TestBuildahBuilder(base.TestCase):
dest = '127.0.0.1:8787/master/fedora-binary-fedora-base:latest'
container_build_path = WORK_DIR + '/' + 'fedora-base'
logfile = '/tmp/kolla/fedora-base/fedora-base-build.log'
buildah_cmd_build = ['--log-level=debug', 'bud', '--format', 'docker',
buildah_cmd_build = ['--log-level=debug', 'bud',
'--loglevel=3', '--format', 'docker',
'--tls-verify=False', '--logfile',
logfile, '-t', dest, container_build_path]
args.extend(buildah_cmd_build)