From 343adaefb51b917cb4b3b764904a6bb0304e1e07 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Tue, 31 Dec 2024 10:25:03 +0800 Subject: [PATCH] review --- .../apache/kyuubi/engine/spark/SparkProcessBuilder.scala | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala index 010fe954fbf..b9b029c249b 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala @@ -337,11 +337,8 @@ class SparkProcessBuilder( } def isK8sClusterMode: Boolean = { - clusterManager().map(_.toLowerCase(Locale.ROOT)) match { - case Some(m) if m.startsWith("k8s") => - deployMode().exists(_.toLowerCase(Locale.ROOT) == "cluster") - case _ => false - } + clusterManager().exists(cm => cm.toLowerCase(Locale.ROOT).startsWith("k8s")) && + deployMode().exists(_.toLowerCase(Locale.ROOT) == "cluster") } def kubernetesContext(): Option[String] = {