From 6828a848eec209e4bafb4777a6a926aef24d5c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Thu, 26 Sep 2024 09:53:45 +0800 Subject: [PATCH] 'commit' --- dsBuild/src/main/java/Util/K8sClientTest.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dsBuild/src/main/java/Util/K8sClientTest.java b/dsBuild/src/main/java/Util/K8sClientTest.java index 0bf25017..a4e4c2dc 100644 --- a/dsBuild/src/main/java/Util/K8sClientTest.java +++ b/dsBuild/src/main/java/Util/K8sClientTest.java @@ -17,14 +17,10 @@ import java.util.regex.Pattern; public class K8sClientTest { - public static void getAllPodList() throws IOException, ApiException { - //Master /root/.kube/config文件拷贝过来 - String kubeConfigPath = PathKit.getRootClassPath() + "\\.kube\\config"; - if (!new File(kubeConfigPath).exists()) { - System.out.println("kubeConfig不存在,跳过"); - return; - } + //Master /root/.kube/config文件拷贝过来 + public static String kubeConfigPath = PathKit.getRootClassPath() + "\\.kube\\config"; + public static void getAllPodList() throws IOException, ApiException { ApiClient apiClient = ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); // new a CoreV1Api CoreV1Api api = new CoreV1Api(apiClient);