Browse Source

[Improvement-12372][k8s] Update the deprecated k8s api (#12373)

3.2.0-release
rickchengx 2 years ago committed by GitHub
parent
commit
7b44612f28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/K8sUtils.java

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

Loading…
Cancel
Save