miaht94 commented on code in PR #7710:
URL: https://github.com/apache/kyuubi/pull/7710#discussion_r3915918247
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala:
##########
@@ -217,14 +217,26 @@ class KubernetesApplicationOperation extends
ApplicationOperation with Logging {
}
private[kyuubi] def getKubernetesClientInitializeInfo(
- kyuubiConf: KyuubiConf): Seq[KubernetesInfo] = {
- kyuubiConf.get(KyuubiConf.KUBERNETES_CLIENT_INITIALIZE_LIST).map { init =>
- val (context, namespace) = init.split(":") match {
- case Array(ctx, ns) => (Some(ctx).filterNot(_.isEmpty),
Some(ns).filterNot(_.isEmpty))
- case Array(ctx) => (Some(ctx).filterNot(_.isEmpty), None)
- case _ => (None, None)
+ kyuubiConf: KyuubiConf,
+ environment: Map[String, String] = sys.env): Seq[KubernetesInfo] = {
+ val configuredInitializeInfo =
+ kyuubiConf.get(KyuubiConf.KUBERNETES_CLIENT_INITIALIZE_LIST).map { init
=>
+ val (context, namespace) = init.split(":") match {
+ case Array(ctx, ns) => (Some(ctx).filterNot(_.isEmpty),
Some(ns).filterNot(_.isEmpty))
+ case Array(ctx) => (Some(ctx).filterNot(_.isEmpty), None)
+ case _ => (None, None)
+ }
+ KubernetesInfo(context, namespace)
}
- KubernetesInfo(context, namespace)
+ if (configuredInitializeInfo.nonEmpty) {
+ configuredInitializeInfo
+ } else if (environment.contains(KUBERNETES_SERVICE_HOST) &&
+ environment.contains(KUBERNETES_SERVICE_PORT)) {
+ Seq(KubernetesInfo(
+ None,
+ Some(kyuubiConf.get(KyuubiConf.KUBERNETES_NAMESPACE))))
Review Comment:
Addressed in 5181e49. The configured namespace is now filtered consistently,
so an empty value produces no namespace override.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]