Skip to content

Commit

Permalink
don't prompt for docker vs. podman if we are in the Malcolm installat…
Browse files Browse the repository at this point in the history
…ion ISO, which we know is docker
  • Loading branch information
mmguero committed Oct 21, 2024
1 parent 3829327 commit 0c2612f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
DotEnvDynamic,
DownloadToFile,
DumpYaml,
GetPlatformOSRelease,
HOMEBREW_INSTALL_URLS,
KubernetesDynamic,
LoadYaml,
Expand Down Expand Up @@ -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}")

Expand Down
8 changes: 8 additions & 0 deletions scripts/malcolm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c2612f

Please sign in to comment.