From 0c2612fc2b1c2e81c9420e7b6693d4ecb4bc1e3f Mon Sep 17 00:00:00 2001 From: Seth Grover Date: Mon, 21 Oct 2024 08:29:43 -0600 Subject: [PATCH] don't prompt for docker vs. podman if we are in the Malcolm installation ISO, which we know is docker --- scripts/install.py | 18 +++++++++++------- scripts/malcolm_common.py | 8 ++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/scripts/install.py b/scripts/install.py index eb0a714e0..52879e881 100755 --- a/scripts/install.py +++ b/scripts/install.py @@ -48,6 +48,7 @@ DotEnvDynamic, DownloadToFile, DumpYaml, + GetPlatformOSRelease, HOMEBREW_INSTALL_URLS, KubernetesDynamic, LoadYaml, @@ -4613,13 +4614,16 @@ def main(): # installer = WindowsInstaller(orchMode, debug=args.debug, configOnly=args.configOnly) if orchMode == OrchestrationFramework.DOCKER_COMPOSE: - runtimeOptions = ('docker', 'podman') - loopBreaker = CountUntilException(MaxAskForValueCount) - while (args.runtimeBin not in runtimeOptions) and loopBreaker.increment(): - args.runtimeBin = InstallerChooseOne( - 'Select container runtime engine', - choices=[(x, '', x == runtimeOptions[0]) for x in runtimeOptions], - ) + if GetPlatformOSRelease() == 'hedgehog-malcolm': + args.runtimeBin = 'docker' + else: + runtimeOptions = ('docker', 'podman') + loopBreaker = CountUntilException(MaxAskForValueCount) + while (args.runtimeBin not in runtimeOptions) and loopBreaker.increment(): + args.runtimeBin = InstallerChooseOne( + 'Select container runtime engine', + choices=[(x, '', x == runtimeOptions[0]) for x in runtimeOptions], + ) if args.debug: eprint(f"Container engine: {args.runtimeBin}") diff --git a/scripts/malcolm_common.py b/scripts/malcolm_common.py index eb9d734ef..52127daf9 100644 --- a/scripts/malcolm_common.py +++ b/scripts/malcolm_common.py @@ -156,6 +156,14 @@ class OrchestrationFramework(Flag): OrchestrationFrameworksSupported = OrchestrationFramework.DOCKER_COMPOSE | OrchestrationFramework.KUBERNETES +################################################################################################## +def GetPlatformOSRelease(): + try: + return platform.freedesktop_os_release().get('VARIANT_ID', None) + except Exception: + return None + + ################################################################################################## def LocalPathForContainerBindMount(service, dockerComposeContents, containerPath, localBasePath=None): localPath = None