Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ExecutorPodsPollingSnapshotSource(

private val pollingInterval = conf.get(KUBERNETES_EXECUTOR_API_POLLING_INTERVAL)
private val pollingEnabled = conf.get(KUBERNETES_EXECUTOR_ENABLE_API_POLLING)
private val namespace = conf.get(KUBERNETES_NAMESPACE)

private var pollingFuture: Future[_] = _

Expand Down Expand Up @@ -76,6 +77,7 @@ class ExecutorPodsPollingSnapshotSource(
logDebug(s"Resynchronizing full executor pod state from Kubernetes.")
val pods = kubernetesClient
.pods()
.inNamespace(namespace)
.withLabel(SPARK_APP_ID_LABEL, applicationId)
.withLabel(SPARK_ROLE_LABEL, SPARK_POD_EXECUTOR_ROLE)
.withoutLabel(SPARK_EXECUTOR_INACTIVE_LABEL, "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class ExecutorPodsPollingSnapshotSourceSuite extends SparkFunSuite with BeforeAn
@Mock
private var podOperations: PODS = _

@Mock
private var namespacedPodOperations: PODS_WITH_NAMESPACE = _

@Mock
private var appIdLabeledPods: LABELED_PODS = _

Expand All @@ -62,7 +65,9 @@ class ExecutorPodsPollingSnapshotSourceSuite extends SparkFunSuite with BeforeAn
MockitoAnnotations.openMocks(this).close()
pollingExecutor = new DeterministicScheduler()
when(kubernetesClient.pods()).thenReturn(podOperations)
when(podOperations.withLabel(SPARK_APP_ID_LABEL, TEST_SPARK_APP_ID))
when(podOperations.inNamespace(defaultConf.get(KUBERNETES_NAMESPACE)))
.thenReturn(namespacedPodOperations)
when(namespacedPodOperations.withLabel(SPARK_APP_ID_LABEL, TEST_SPARK_APP_ID))
.thenReturn(appIdLabeledPods)
when(appIdLabeledPods.withLabel(SPARK_ROLE_LABEL, SPARK_POD_EXECUTOR_ROLE))
.thenReturn(executorRoleLabeledPods)
Expand Down