Skip to content

Instantly share code, notes, and snippets.

@Malinskiy
Created July 16, 2018 16:56
Show Gist options
  • Select an option

  • Save Malinskiy/03c327715aebbbd41bf5dfee6257304d to your computer and use it in GitHub Desktop.

Select an option

Save Malinskiy/03c327715aebbbd41bf5dfee6257304d to your computer and use it in GitHub Desktop.
kubernetesClient = new DefaultKubernetesClient() 
updateFlag = new AtomicBoolean(true)  
void watch() { 
println("Start watching")  
kubernetesClient.events().inNamespace(namespaceName).watch(new Watcher < Event > () { 
@Override  void eventReceived(Action action, Event resource) { 
// println("Event " + action.name() + " " + resource.toString())
updateFlag.set(true) 
}
@Override  void onClose(KubernetesClientException cause) { 
println("Watcher close due to " + cause)  watch() 
}) 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment