From 17665df3846946d51b3f817993a141f82cc56b42 Mon Sep 17 00:00:00 2001 From: Robert Cerven Date: Thu, 15 Dec 2022 16:36:54 +0100 Subject: [PATCH] pass default and max build times from osbs.conf via kwargs to create_binary_container_build * CLOUDBLD-9913 Signed-off-by: Robert Cerven --- koji_containerbuild/plugins/builder_containerbuild.py | 5 +++++ tests/test_builder_containerbuild.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/koji_containerbuild/plugins/builder_containerbuild.py b/koji_containerbuild/plugins/builder_containerbuild.py index 708a0ed..3c448fd 100644 --- a/koji_containerbuild/plugins/builder_containerbuild.py +++ b/koji_containerbuild/plugins/builder_containerbuild.py @@ -830,6 +830,11 @@ def createContainer(self, src=None, target_info=None, arches=None, if release: create_build_args['release'] = release + create_build_args['default_buildtime_limit'] =\ + self.osbs().os_conf.get_default_buildtime_limit() + create_build_args['max_buildtime_limit'] =\ + self.osbs().os_conf.get_max_buildtime_limit() + try: create_method = self.osbs().create_binary_container_build self.logger.debug("Starting %s with params: '%s", diff --git a/tests/test_builder_containerbuild.py b/tests/test_builder_containerbuild.py index 4a84d4c..78029bb 100644 --- a/tests/test_builder_containerbuild.py +++ b/tests/test_builder_containerbuild.py @@ -384,6 +384,10 @@ def _mock_osbs(self, koji_build_id, src, koji_task_id, source=False, if not create_build_args.get('userdata'): create_build_args.pop('userdata', None) + if not source: + create_build_args['default_buildtime_limit'] = 10800 + create_build_args['max_buildtime_limit'] = 21600 + if source: (flexmock(osbs.api.OSBS) .should_receive('create_source_container_build')