Skip to content

Commit

Permalink
Merge pull request #790 from rhatdan/optimize
Browse files Browse the repository at this point in the history
Stash output from container_manager
  • Loading branch information
ericcurtin authored Feb 12, 2025
2 parents 96cd5a3 + 75e5ce9 commit c02cc6f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions ramalama/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,30 @@
DEFAULT_IMAGE = "quay.io/ramalama/ramalama"


_engine = ""


def container_manager():
global _engine
if _engine != "":
if _engine == "None":
return None
return _engine

_engine = "None"
engine = os.getenv("RAMALAMA_CONTAINER_ENGINE")
if engine is not None:
return engine
_engine = engine
return _engine

if available("podman"):
if sys.platform != "darwin" or is_podman_machine_running_with_krunkit():
return "podman"

return None
_engine = "podman"
return _engine

if available("docker"):
return "docker"
_engine = "docker"
return _engine

return None

Expand Down

0 comments on commit c02cc6f

Please sign in to comment.