Skip to content

Commit 0cf0d02

Browse files
ash211foxish
authored andcommitted
Fix NPE around unschedulable pod specs (alteryx#79)
1 parent ab731f1 commit 0cf0d02

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)