Skip to content

Commit de9a82e

Browse files
committed
Fix NPE around unschedulable pod specs (apache#79)
1 parent d0f95db commit de9a82e

File tree

1 file changed

+2
-1
lines changed
  • resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes

1 file changed

+2
-1
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/Client.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ private[spark] class Client(
570570
.filter(_.getName == SUBMISSION_SERVER_PORT_NAME)
571571
.head.getNodePort
572572
val nodeUrls = kubernetesClient.nodes.list.getItems.asScala
573-
.filterNot(_.getSpec.getUnschedulable)
573+
.filterNot(node => node.getSpec.getUnschedulable != null &&
574+
node.getSpec.getUnschedulable)
574575
.flatMap(_.getStatus.getAddresses.asScala.map(address => {
575576
s"$urlScheme://${address.getAddress}:$servicePort"
576577
})).toArray

0 commit comments

Comments
 (0)