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

weiraowang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 742a2dc780 [Fix-14447][K8S Task] Fix IndexOutofBoundsException for pod 
name without dash (#14448)
742a2dc780 is described below

commit 742a2dc780b7c84d5da52d7ede348fe9a57bbe84
Author: fuchanghai <[email protected]>
AuthorDate: Fri Jul 7 12:53:16 2023 +0800

    [Fix-14447][K8S Task] Fix IndexOutofBoundsException for pod name without 
dash (#14448)
---
 .../org/apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java
 
b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java
index dc00b1e57c..ca8347b19b 100644
--- 
a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java
+++ 
b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java
@@ -96,7 +96,7 @@ public class K8sUtils {
             String podName = null;
             for (Pod pod : podList) {
                 podName = pod.getMetadata().getName();
-                if (jobName.equals(podName.substring(0, 
pod.getMetadata().getName().lastIndexOf("-")))) {
+                if (podName.contains("-") && 
jobName.equals(podName.substring(0, podName.lastIndexOf("-")))) {
                     break;
                 }
             }

Reply via email to