This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-23637
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c6e67a3b96c6aa4803200263c7ee006494444633
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri May 29 09:05:22 2026 +0200

    CAMEL-23615: camel-jbang - TUI check Docker/Podman before opening Run Infra 
Service
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../dsl/jbang/core/commands/tui/ActionsPopup.java  | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ActionsPopup.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ActionsPopup.java
index e448c3cc73f5..831f7937d8ad 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ActionsPopup.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ActionsPopup.java
@@ -18,6 +18,7 @@ package org.apache.camel.dsl.jbang.core.commands.tui;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -1317,6 +1318,10 @@ class ActionsPopup {
 
     private void openInfraBrowser() {
         showActionsMenu = false;
+        if (!isContainerRuntimeAvailable()) {
+            setNotification("Docker or Podman is not running (use F2 → Run 
Doctor to check)", true);
+            return;
+        }
         if (infraCatalog == null) {
             infraCatalog = loadInfraCatalog();
         }
@@ -1730,6 +1735,24 @@ class ActionsPopup {
         return lines;
     }
 
+    private static boolean isContainerRuntimeAvailable() {
+        for (String cmd : new String[] { "docker", "podman" }) {
+            try {
+                Process p = new ProcessBuilder(cmd, "info")
+                        .redirectErrorStream(true)
+                        .start();
+                p.getInputStream().transferTo(OutputStream.nullOutputStream());
+                int exit = p.waitFor();
+                if (exit == 0) {
+                    return true;
+                }
+            } catch (Exception e) {
+                // not found, try next
+            }
+        }
+        return false;
+    }
+
     record InfraServiceEntry(String alias, String description, List<String> 
implementations, boolean running) {
     }
 

Reply via email to