Skip to content

Commit

Permalink
Updates from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejbrown committed Jan 17, 2024
1 parent d3f6f29 commit 9615c4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions buildrunner/steprunner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ def run(self):
for _task_name, _task_config in self.config.items():
self.log.write(f"==> Running step: {self.name}:{_task_name}\n")
if _task_name in TASK_MAPPINGS:
if self.local_images and _task_name in ["build", "run", "services"]:
_task_config["pull"] = False
if self.platform and _task_name in ["build", "run"]:
_task_config["platform"] = self.platform
if TASK_MAPPINGS[_task_name] in [
BuildBuildStepRunnerTask,
RunBuildStepRunnerTask,
]:
if self.local_images:
_task_config["pull"] = False
if self.platform:
_task_config["platform"] = self.platform
_task = TASK_MAPPINGS[_task_name](self, _task_config)
_tasks.append(_task)
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_buildrunner_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _get_test_args(file_name: str) -> Optional[List[str]]:
return ["--platform", "linux/amd64"]

if file_name == "test-local-images-and-platform.yaml":
# Override platform to amd
# Override platform to amd and use local images
return ["--local-images", "--platform", "linux/amd64"]

# No additional args for this test file
Expand Down

0 comments on commit 9615c4c

Please sign in to comment.