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