From f56528df32e1d65ca909b6b73c7a3962f4cc9b42 Mon Sep 17 00:00:00 2001 From: Jana Librova Date: Jan 09 2025 11:37:02 +0000 Subject: Add new option for mock option - bootstrap_image_ready Fixes: https://pagure.io/koji/issue/3958 --- diff --git a/builder/kojid b/builder/kojid index 9b4f46f..38b85a0 100755 --- a/builder/kojid +++ b/builder/kojid @@ -469,6 +469,8 @@ class BuildRoot(object): cmd.append('--new-chroot') else: cmd.append('--old-chroot') + if self.config['extra'].get('mock.bootstrap_image_ready', False): + cmd.append('--bootstrap-image-ready') cmd.extend(args) self.logger.info(format_shell_cmd(cmd)) workdir = getattr(self, 'workdir', None) diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 29b6e0a..783a379 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -1188,6 +1188,9 @@ def anon_handle_mock_config(goptions, session, args): opts['bootstrap_image'] = buildcfg['extra']['mock.bootstrap_image'] else: opts['use_bootstrap_image'] = False + if 'mock.bootstrap_image_ready' in buildcfg['extra']: + opts['bootstrap_image_ready'] = bool(buildcfg['extra']['mock.bootstrap_image_ready']) + # no else part as it would be driven by site-defaults.cfg if 'mock.use_bootstrap' in buildcfg['extra']: opts['use_bootstrap'] = buildcfg['extra']['mock.use_bootstrap'] if 'mock.module_setup_commands' in buildcfg['extra']: diff --git a/docs/source/using_the_koji_build_system.rst b/docs/source/using_the_koji_build_system.rst index c77f252..cc237f1 100644 --- a/docs/source/using_the_koji_build_system.rst +++ b/docs/source/using_the_koji_build_system.rst @@ -437,6 +437,11 @@ environment follows: - this option will automatically turn ``mock.use_bootstrap`` (this is how it is implemented in mock) + +* ``mock.bootstrap_image_ready`` - For the specification that we are ready for bootstrapping. + If we want to specify, that we are ready for bootstrapping, we need to know that these + two packages `python3-dnf` and `python3-dnf-plugins-coreare installed in the container. + * ``mock.module_setup_commands`` - commands for configuring the modules active in a buildroot. Available in `mock 2.4 `__. diff --git a/tests/test_cli/test_mock_config.py b/tests/test_cli/test_mock_config.py index 95faef2..b4201e1 100644 --- a/tests/test_cli/test_mock_config.py +++ b/tests/test_cli/test_mock_config.py @@ -254,6 +254,7 @@ config_opts['macros']['%distribution'] = 'Koji Testing' 'mock.yum.best': 10, 'mock.bootstrap_image': 'bootstrap_image_content', 'mock.use_bootstrap': True, + 'mock.bootstrap_image_ready': True, 'mock.module_setup_commands': 'module_setup_commands_content', 'mock.releasever': 'releasever_content', }, @@ -297,6 +298,7 @@ config_opts['macros']['%distribution'] = 'Koji Testing' 'releasever': 'releasever_content', 'use_bootstrap': True, 'use_bootstrap_image': True, + 'bootstrap_image_ready': True, 'yum_best': 10, })