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

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


The following commit(s) were added to refs/heads/main by this push:
     new 38ae8697b4e CAMEL-22032: camel-jbang - Regression with k8s pod logs 
(#17915)
38ae8697b4e is described below

commit 38ae8697b4e339803aca3f4ab16502ca2dbeb566
Author: Thomas Diesler <[email protected]>
AuthorDate: Tue Apr 29 13:26:07 2025 +0200

    CAMEL-22032: camel-jbang - Regression with k8s pod logs (#17915)
---
 dsl/camel-jbang/camel-jbang-plugin-kubernetes/pom.xml          | 10 ++++++++++
 .../dsl/jbang/core/commands/kubernetes/KubernetesPodLogs.java  |  7 ++++++-
 test-infra/camel-test-infra-jetty/pom.xml                      |  9 +++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/pom.xml 
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/pom.xml
index 8ff514fa11f..58e67755f5a 100644
--- a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/pom.xml
+++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/pom.xml
@@ -84,6 +84,16 @@
             <artifactId>camel-test-junit5</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <!--
+                Likely needed when running tests in IntelliJ
+                https://issues.apache.org/jira/browse/CAMEL-21860
+            -->
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-infra-common</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-test-infra-common</artifactId>
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesPodLogs.java
 
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesPodLogs.java
index ebb1d5a95d1..488761fe392 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesPodLogs.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesPodLogs.java
@@ -138,7 +138,12 @@ public class KubernetesPodLogs extends 
KubernetesBaseCommand {
     }
 
     private boolean isPodTerminated(PodResource podRes) {
-        var phase = Optional.ofNullable(podRes).map(pr -> 
getPodPhase(pr.get())).orElse("Unknown");
+        var phase = "Unknown";
+        try {
+            phase = Optional.ofNullable(podRes).map(pr -> 
getPodPhase(pr.get())).orElse(phase);
+        } catch (RuntimeException ex) {
+            printer().printErr(ex);
+        }
         return "Terminated".equals(phase);
     }
 
diff --git a/test-infra/camel-test-infra-jetty/pom.xml 
b/test-infra/camel-test-infra-jetty/pom.xml
index d70ce532300..1f16e5ea712 100644
--- a/test-infra/camel-test-infra-jetty/pom.xml
+++ b/test-infra/camel-test-infra-jetty/pom.xml
@@ -31,6 +31,15 @@
     <name>Camel :: Test Infra :: Jetty</name>
 
     <dependencies>
+        <dependency>
+            <!--
+                Likely needed when running tests in IntelliJ
+                https://issues.apache.org/jira/browse/CAMEL-21860
+            -->
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-infra-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-test-infra-common</artifactId>

Reply via email to