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 f832acf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import java.util.Properties

import io.fabric8.kubernetes.api.model._
import io.fabric8.kubernetes.client.{KubernetesClient, KubernetesClientException, Watch}
import io.fabric8.kubernetes.client.Watcher.Action
import scala.collection.mutable
import scala.util.control.NonFatal
import util.control.Breaks._
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 f832acf

Please sign in to comment.