From a74851843979560b521a2cc5ece6bd174b400a2b Mon Sep 17 00:00:00 2001 From: Fei Wang Date: Mon, 1 Jun 2026 21:44:49 -0700 Subject: [PATCH] [KYUUBI #7441] Fix duplicate containerStatuses in Kubernetes app diagnose error output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building the application error diagnostic JSON, PodStatus is serialized as the full Kubernetes PodStatus object which already embeds containerStatuses[] internally. ContainerStatus is then separately included as a sibling key — for a single-container pod (e.g. Spark driver), these two fields contain identical data. Fix: clear containerStatuses on the PodStatus object before serializing, in the branch where ContainerStatus is separately present. The POD-mode fallback (no ContainerStatus sibling) is unaffected and retains the full PodStatus. Before: PodStatus.containerStatuses[0] == ContainerStatus (duplicated) After: PodStatus contains only pod-level info (conditions, phase, IPs) ContainerStatus contains the full driver container state --- .../apache/kyuubi/engine/KubernetesApplicationOperation.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala index 0160f9077ba..0f9082966f8 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala @@ -664,6 +664,7 @@ object KubernetesApplicationOperation extends Logging { applicationState, supportPersistedAppState = true) || applicationState == ApplicationState.PENDING) { val errorMap = containerStatusToBuildAppState.map { cs => + pod.getStatus.setContainerStatuses(Seq.empty.asJava) Map( "Pod" -> podName, "PodStatus" -> pod.getStatus,