|
|
|
@@ -404,10 +404,10 @@ public class K8sClientUtil { |
|
|
|
return pod.getStatus().getPhase(); |
|
|
|
} |
|
|
|
|
|
|
|
public static String getPodLogs(String podName,String namespace,int line) { |
|
|
|
public static String getPodLogs(String podName,String namespace,String container,int line) { |
|
|
|
CoreV1Api api = new CoreV1Api(apiClient); |
|
|
|
try { |
|
|
|
String log = api.readNamespacedPodLog(podName, namespace, null, null, null, null, null,null, null, line, null); |
|
|
|
String log = api.readNamespacedPodLog(podName, namespace, StringUtils.isEmpty(container)?null:container, null, null, null, null,null, null, line, null); |
|
|
|
return log; |
|
|
|
} catch (ApiException e) { |
|
|
|
throw new RuntimeException("获取Pod日志异常", e); |
|
|
|
|