Browse Source

[Fix-14447][K8S Task] Fix IndexOutofBoundsException for pod name without dash (#14448)

3.2.1-prepare
fuchanghai 1 year ago committed by GitHub
parent
commit
742a2dc780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java

2
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;
}
}

Loading…
Cancel
Save