From 20a7e4d77cf62de4768aa5631e05451b39fc4ccf Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 5 Nov 2024 04:45:37 -0500 Subject: [PATCH] `KubernetesAgentErrorCondition` failed to handle DR (#1617) --- .../kubernetes/pipeline/KubernetesAgentErrorCondition.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesAgentErrorCondition.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesAgentErrorCondition.java index cad742400..5a14c32af 100644 --- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesAgentErrorCondition.java +++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesAgentErrorCondition.java @@ -128,7 +128,8 @@ public boolean test(@NonNull Throwable t, @CheckForNull StepContext context) } Set terminationReasons = ExtensionList.lookupSingleton(Reaper.class).terminationReasons(node); - if (terminationReasons.stream().allMatch(IGNORED_CONTAINER_TERMINATION_REASONS::contains)) { + if (!terminationReasons.isEmpty() + && terminationReasons.stream().allMatch(IGNORED_CONTAINER_TERMINATION_REASONS::contains)) { listener.getLogger() .println("Ignored termination reason(s) for " + node + " for purposes of retry: " + terminationReasons);