Radeity commented on code in PR #14379:
URL:
https://github.com/apache/dolphinscheduler/pull/14379#discussion_r1258210034
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/am/KubernetesApplicationManager.java:
##########
@@ -181,15 +181,15 @@ private TaskExecutionStatus
getApplicationStatus(KubernetesApplicationManagerCon
public LogWatch getPodLogWatcher(KubernetesApplicationManagerContext
kubernetesApplicationManagerContext) {
KubernetesClient client =
getClient(kubernetesApplicationManagerContext);
FilterWatchListDeletable<Pod, PodList, PodResource> watchList =
- getDriverPod(kubernetesApplicationManagerContext);
- List<Pod> driverPod = watchList.list().getItems();
- if (CollectionUtils.isEmpty(driverPod)) {
+ getListenPod(kubernetesApplicationManagerContext);
+ List<Pod> podList = watchList.list().getItems();
+ if (CollectionUtils.isEmpty(podList)) {
return null;
}
- Pod driver = driverPod.get(0);
+ Pod pod = podList.get(0);
Review Comment:
> Not sure if there will be multiple Pods. Maybe you should filter the
latest pods based on when they were created?
You are right, one job can launch multiple pods. For this scenario, I think
it's better support to read logs from different pods in future PR, rather read
from the latest one, WDYT?
> When getting the pod list, maybe add jobname as a label filter?
The label value here is `taskAppId` which can behave like a unique
identifier of one job.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]