Created
July 16, 2018 16:56
-
-
Save Malinskiy/03c327715aebbbd41bf5dfee6257304d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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