Skip to content

Commit 03865cc

Browse files
committed
src/tarball.py: Trust BuildConfig data from the Nodes
This patch drops the double-check with static Pipeline configuration since it may be dynamically loaded from an external source in the Trigger Service. Signed-off-by: Paweł Wieczorek <[email protected]>
1 parent 833dda8 commit 03865cc

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/tarball.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import kernelci
1919
import kernelci.build
2020
import kernelci.config
21+
from kernelci.legacy.config.build import BuildConfig, Tree
2122
from kernelci.legacy.cli import Args, Command, parse_opts
2223
import kernelci.storage
2324

@@ -41,7 +42,6 @@ class Tarball(Service):
4142
def __init__(self, global_configs, service_config, name):
4243
super().__init__(global_configs, service_config, name)
4344
self._service_config = service_config
44-
self._build_configs = global_configs['build_configs']
4545
if not os.path.exists(self._service_config.output):
4646
os.makedirs(self._service_config.output)
4747
storage_config = global_configs['storage_configs'][
@@ -51,17 +51,12 @@ def __init__(self, global_configs, service_config, name):
5151
storage_config, service_config.storage_cred
5252
)
5353

54-
def _find_build_config(self, node):
54+
def _create_build_config(self, node):
5555
revision = node['data']['kernel_revision']
5656
tree = revision['tree']
57+
url = revision['url']
5758
branch = revision['branch']
58-
for config in self._build_configs.values():
59-
if config.tree.name == tree and config.branch == branch:
60-
return config
61-
if config.tree.name == tree and config.branch.startswith('http'):
62-
current = copy.copy(config)
63-
current._branch = branch
64-
return current
59+
return BuildConfig(tree, Tree(tree, url), branch, {})
6560

6661
def _find_build_commit(self, node):
6762
revision = node['data'].get('kernel_revision')
@@ -229,10 +224,7 @@ def _run(self, sub_id):
229224
continue
230225
subscribe_retries = 0
231226

232-
build_config = self._find_build_config(checkout_node)
233-
if build_config is None:
234-
continue
235-
227+
build_config = self._create_build_config(checkout_node)
236228
if self._update_repo(build_config):
237229
self.log.error("Failed to update repo, retrying")
238230
if self._update_repo(build_config):

0 commit comments

Comments
 (0)