aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2019-12-17 08:47:42 +0100
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2020-01-27 12:46:37 +0100
commitfa2e1304362d3b81b9903b77d180aa2eb3f1af8b (patch)
tree586c65527d332a17d1c5f8cc29c2bcad49a47e2b
parent7a57a4230a496250725ae6cd6012eea2a12fe799 (diff)
downloadkolla-fa2e1304362d3b81b9903b77d180aa2eb3f1af8b.tar.gz
kolla-fa2e1304362d3b81b9903b77d180aa2eb3f1af8b.zip
build: list only buildable templates for --template-only
TripleO uses --template-only to generate Dockerfiles and then use buildah to create container images. But as Kolla generates all files then they need to have a way to exclude not buildable ones. https://review.opendev.org/#/c/699024 is one of such attempts. But if we remove not buildable Dockerfiles then they get what they can build. Change-Id: I7a92b762f6a783f92ebca61e5595e1422a92df4f
-rwxr-xr-xkolla/image/build.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py
index 9108fe5e4..a6cc4719e 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -1433,6 +1433,16 @@ def run_build():
kolla.create_dockerfiles()
if conf.template_only:
+ kolla.build_image_list()
+ kolla.find_parents()
+ kolla.filter_images()
+
+ for image in kolla.images:
+ if image.status == STATUS_MATCHED:
+ continue
+
+ shutil.rmtree(image.path)
+
LOG.info('Dockerfiles are generated in %s', kolla.working_dir)
return