Merge "buildah: exclude build and push, not only build" into stable/train

This commit is contained in:
Zuul 2020-05-18 05:43:33 +00:00 committed by Gerrit Code Review
commit 4394dac843
2 changed files with 5 additions and 8 deletions

View File

@ -114,6 +114,9 @@ class BuildahBuilder(base.BaseBuilder):
:params container_name: Name of the container.
"""
if container_name in self.excludes:
return
self.build(container_name, self._find_container_dir(container_name))
if self.push_containers:
self.push(self._get_destination(container_name))
@ -126,9 +129,6 @@ class BuildahBuilder(base.BaseBuilder):
Containerfile and other files are located to build the image.
"""
if container_name in self.excludes:
return
# 'buildah bud' is the command we want because Kolla uses Dockefile to
# build images.
# TODO(emilien): Stop ignoring TLS. The deployer should either secure

View File

@ -141,11 +141,8 @@ class TestBuildahBuilder(base.TestCase):
@mock.patch.object(process, 'execute', autospec=True)
def test_build_with_excludes(self, mock_process):
container_build_path = WORK_DIR + '/' + 'fedora-base'
bb(WORK_DIR, DEPS, excludes=['fedora-base']).build(
'fedora-base',
container_build_path
)
bb(WORK_DIR, DEPS, excludes=['fedora-base'])._generate_container(
'fedora-base')
assert not mock_process.called
@mock.patch.object(process, 'execute', autospec=True)