From 41dc35dc3145ad8933a9bf6a5f0580a85810a317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Mon, 10 Apr 2017 10:52:44 +0200 Subject: [PATCH] Skip [plugins,additions]-archive for binary builts Skip the creation of `plugins-archive` or `additions-archive` for binary builds as they are only checked-out as part of the source build process. Doing so also has the nice side-effect of failing the build in case someone accidently includes an 'ADD plugins-archive /' instruction to the binary section of a Dockerfile. Change-Id: I7442fcd9677466dd0878e124402b4d4170a1ab68 Related-Bug: #1681345 --- kolla/image/build.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/kolla/image/build.py b/kolla/image/build.py index ff2409c631..5118f27239 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -419,26 +419,27 @@ class BuildTask(DockerTask): if image.status in STATUS_ERRORS: return - try: - plugins_am = make_an_archive(image.plugins, 'plugins') - except ArchivingError: - self.logger.error( - "Failed turning any plugins into a plugins archive") - return - else: - self.logger.debug( - "Turned %s plugins into plugins archive", - plugins_am) - try: - additions_am = make_an_archive(image.additions, 'additions') - except ArchivingError: - self.logger.error( - "Failed turning any additions into a additions archive") - return - else: - self.logger.debug( - "Turned %s additions into additions archive", - additions_am) + if self.conf.install_type == 'source': + try: + plugins_am = make_an_archive(image.plugins, 'plugins') + except ArchivingError: + self.logger.error( + "Failed turning any plugins into a plugins archive") + return + else: + self.logger.debug( + "Turned %s plugins into plugins archive", + plugins_am) + try: + additions_am = make_an_archive(image.additions, 'additions') + except ArchivingError: + self.logger.error( + "Failed turning any additions into a additions archive") + return + else: + self.logger.debug( + "Turned %s additions into additions archive", + additions_am) # Pull the latest image for the base distro only pull = self.conf.pull if image.parent is None else False