Merge "buildah: exclude build and push, not only build" into stable/train
This commit is contained in:
commit
4394dac843
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user