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

kerwin pushed a commit to branch 3.1.1-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git

commit 5cfe6a96b41d95da067702d6dfcf499690b17f6c
Author: rickchengx <[email protected]>
AuthorDate: Fri Oct 14 16:18:35 2022 +0800

    [Improvement-12372][k8s] Update the deprecated k8s api (#12373)
---
 .../apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 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 2733cebae3..c50596bb02 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
@@ -44,6 +44,7 @@ public class K8sUtils {
     public void createJob(String namespace, Job job) {
         try {
             client.batch()
+                    .v1()
                     .jobs()
                     .inNamespace(namespace)
                     .create(job);
@@ -55,6 +56,7 @@ public class K8sUtils {
     public void deleteJob(String jobName, String namespace) {
         try {
             client.batch()
+                    .v1()
                     .jobs()
                     .inNamespace(namespace)
                     .withName(jobName)
@@ -81,7 +83,10 @@ public class K8sUtils {
     public Watch createBatchJobWatcher(String jobName, Watcher<Job> watcher) {
         try {
             return client.batch()
-                    .jobs().withName(jobName).watch(watcher);
+                    .v1()
+                    .jobs()
+                    .withName(jobName)
+                    .watch(watcher);
         } catch (Exception e) {
             throw new TaskException("fail to register batch job watcher", e);
         }

Reply via email to