Skip to content

Commit

Permalink
Fetch latest state before continuing
Browse files Browse the repository at this point in the history
  • Loading branch information
stijndehaes committed May 4, 2020
1 parent a9ce548 commit 2a4cbb6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import java.util.{Collections, UUID}
import java.util.Properties

import io.fabric8.kubernetes.api.model._
import io.fabric8.kubernetes.client.Watcher.Action
import io.fabric8.kubernetes.client.{KubernetesClient, KubernetesClientException, Watch}

import scala.collection.mutable
import scala.util.control.NonFatal
import util.control.Breaks._

import org.apache.spark.SparkConf
import org.apache.spark.deploy.SparkApplication
import org.apache.spark.deploy.k8s._
Expand Down Expand Up @@ -145,10 +146,9 @@ private[spark] class Client(
breakable {
while (true) {
try {
watch = kubernetesClient
.pods()
.withName(driverPodName)
.watch(watcher)
val podWithName = kubernetesClient.pods().withName(driverPodName)
watch = podWithName.watch(watcher)
watcher.eventReceived(Action.MODIFIED, podWithName.get())
watcher.watchOrStop(sId)
break
} catch {
Expand Down

0 comments on commit 2a4cbb6

Please sign in to comment.