| |
@@ -0,0 +1,54 @@
|
| |
+ From 59794aaa1d3c1f36bd150da79ce6773f6ba82f32 Mon Sep 17 00:00:00 2001
|
| |
+ From: "Owen W. Taylor" <otaylor@fishsoup.net>
|
| |
+ Date: Thu, 15 Feb 2018 15:24:22 -0500
|
| |
+ Subject: [PATCH] render_import_image: fix logic for checking
|
| |
+ imagestream_name/url
|
| |
+
|
| |
+ The code was checking for spec.imagestream_name is None not
|
| |
+ spec.imagestream_name.value is None - this was never noticed because
|
| |
+ spec.imagestream_name is now always set except for Flatpak builds and
|
| |
+ previously, a different check was removing the plugin first.
|
| |
+
|
| |
+ Check in tests that the plugin is properly removed for Flatpak builds.
|
| |
+ ---
|
| |
+ osbs/build/build_request.py | 2 +-
|
| |
+ tests/build_/test_build_request.py | 3 +++
|
| |
+ 2 files changed, 4 insertions(+), 1 deletion(-)
|
| |
+
|
| |
+ diff --git a/osbs/build/build_request.py b/osbs/build/build_request.py
|
| |
+ index 66be128..5c77e7d 100644
|
| |
+ --- a/osbs/build/build_request.py
|
| |
+ +++ b/osbs/build/build_request.py
|
| |
+ @@ -1300,7 +1300,7 @@ class BuildRequest(object):
|
| |
+ """
|
| |
+ phase = 'postbuild_plugins'
|
| |
+ plugin = 'import_image'
|
| |
+ - if self.spec.imagestream_name is None or self.spec.imagestream_url is None:
|
| |
+ + if self.spec.imagestream_name.value is None or self.spec.imagestream_url.value is None:
|
| |
+ logger.info("removing %s from request, "
|
| |
+ "registry or repo url is not defined", plugin)
|
| |
+ self.dj.remove_plugin(phase, plugin)
|
| |
+ diff --git a/tests/build_/test_build_request.py b/tests/build_/test_build_request.py
|
| |
+ index 9fdfccc..a624468 100644
|
| |
+ --- a/tests/build_/test_build_request.py
|
| |
+ +++ b/tests/build_/test_build_request.py
|
| |
+ @@ -1245,6 +1245,8 @@ class TestBuildRequest(object):
|
| |
+ assert get_plugin(plugins, "prepublish_plugins", "flatpak_create_oci")
|
| |
+ with pytest.raises(NoSuchPluginException):
|
| |
+ assert get_plugin(plugins, "prepublish_plugins", "squash")
|
| |
+ + with pytest.raises(NoSuchPluginException):
|
| |
+ + assert get_plugin(plugins, "postbuild_plugins", "import_image")
|
| |
+
|
| |
+ def test_render_prod_not_flatpak(self):
|
| |
+ build_request = BuildRequest(INPUTS_PATH)
|
| |
+ @@ -1283,6 +1285,7 @@ class TestBuildRequest(object):
|
| |
+ with pytest.raises(NoSuchPluginException):
|
| |
+ get_plugin(plugins, "prepublish_plugins", "flatpak_create_oci")
|
| |
+ assert get_plugin(plugins, "prepublish_plugins", "squash")
|
| |
+ + assert get_plugin(plugins, "postbuild_plugins", "import_image")
|
| |
+
|
| |
+ @pytest.mark.parametrize(('hub', 'disabled', 'release'), (
|
| |
+ ('http://hub/', False, None),
|
| |
+ --
|
| |
+ 2.14.3
|
| |
+
|
| |
https://github.com/projectatomic/osbs-client/pull/730