From a8f8ffc223f4d57e4a3a0a6300d0cb3d675a08fa Mon Sep 17 00:00:00 2001 From: Jim Grady Date: Sat, 30 Jul 2022 07:48:13 -0400 Subject: [PATCH] Fix build command for Rancher Desktop Fix error introduced in PR #1677. Previous implementation used os.system which takes a string. #1677 changed to use subprocess.run which takes a List. When building for Rancher Desktop, the namespace was part of the build_cmd string instead of separate elements in the list. --- deploy/scripts/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/scripts/build.py b/deploy/scripts/build.py index c2b6d14d97..214d5fe66e 100755 --- a/deploy/scripts/build.py +++ b/deploy/scripts/build.py @@ -92,9 +92,9 @@ def main() -> None: logging.basicConfig(format="%(levelname)s:%(message)s", level=log_level) if args.nerdctl: - build_cmd = f"nerdctl -n {args.namespace}" + build_cmd = ["nerdctl", "-n", args.namespace] else: - build_cmd = "docker" + build_cmd = ["docker"] if args.components is not None: to_do = args.components @@ -120,13 +120,13 @@ def main() -> None: logging.info(f"Building component {component}") print_all = args.output_level == "all" run_cmd( - [build_cmd, "build", "-t", image_name, "-f", "Dockerfile", "."], + build_cmd + ["build", "-t", image_name, "-f", "Dockerfile", "."], print_cmd=print_all, print_output=print_all, ) logging.info(f"{component} build complete") if args.repo is not None: - run_cmd([build_cmd, "push", image_name]) + run_cmd(build_cmd + ["push", image_name]) logging.info(f"{image_name} pushed to {args.repo}") # Remove the version file