Skip to content

Commit

Permalink
doc: update wrong exception type in Watcher onClose argument
Browse files Browse the repository at this point in the history
Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia authored Sep 4, 2024
1 parent 079a7b8 commit 6758880
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -209,15 +209,15 @@ SecurityContextConstraints scc = new SecurityContextConstraintsBuilder()
Use `io.fabric8.kubernetes.api.model.Event` as T for Watcher:

```java
client.events().inAnyNamespace().watch(new Watcher<Event>() {
client.events().inAnyNamespace().watch(new Watcher<>() {

@Override
public void eventReceived(Action action, Event resource) {
System.out.println("event " + action.name() + " " + resource.toString());
}

@Override
public void onClose(KubernetesClientException cause) {
public void onClose(WatcherException cause) {
System.out.println("Watcher close due to " + cause);
}

@@ -339,7 +339,7 @@ public void testInCrudMode() {
assertEquals(1, podList.getItems().size());

//WATCH
Watch watch = client.pods().inNamespace("ns1").withName("pod1").watch(new Watcher<Pod>() {
Watch watch = client.pods().inNamespace("ns1").withName("pod1").watch(new Watcher<>() {
@Override
public void eventReceived(Action action, Pod resource) {
switch (action) {
@@ -352,7 +352,7 @@ public void testInCrudMode() {
}

@Override
public void onClose(KubernetesClientException cause) {
public void onClose(WatcherException cause) {
closeLatch.countDown();
}
});

0 comments on commit 6758880

Please sign in to comment.