-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deps : Update Fabric8 Kubernetes Client to v6.9.0
Signed-off-by: Rohan Kumar <rohaan@redhat.com>
- Loading branch information
1 parent
bb28490
commit 07f76a0
Showing
4 changed files
with
53 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
37 changes: 37 additions & 0 deletions
37
src/main/java/io/fabric8/CustomResourceInformerLabels.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.fabric8; | ||
|
||
import io.fabric8.crd.mode.v1.Dummy; | ||
import io.fabric8.kubernetes.client.KubernetesClient; | ||
import io.fabric8.kubernetes.client.KubernetesClientBuilder; | ||
import io.fabric8.kubernetes.client.informers.ResourceEventHandler; | ||
import io.fabric8.kubernetes.client.informers.SharedIndexInformer; | ||
|
||
public class CustomResourceInformerLabels { | ||
public static void main(String[] args) { | ||
try (KubernetesClient client = new KubernetesClientBuilder().build()) { | ||
ResourceEventHandler<Dummy> myEventHandler = new ResourceEventHandler<>() { | ||
@Override | ||
public void onAdd(Dummy dummy) { | ||
System.out.printf("ADDED %s/%s\n", dummy.getMetadata().getNamespace(), dummy.getMetadata().getName()); | ||
} | ||
|
||
@Override | ||
public void onUpdate(Dummy dummy, Dummy t1) { | ||
System.out.printf("MODIFIED %s/%s\n", dummy.getMetadata().getNamespace(), dummy.getMetadata().getName()); | ||
|
||
} | ||
|
||
@Override | ||
public void onDelete(Dummy dummy, boolean b) { | ||
System.out.printf("DELETED %s/%s\n", dummy.getMetadata().getNamespace(), dummy.getMetadata().getName()); | ||
} | ||
}; | ||
SharedIndexInformer<Dummy> informer = client.resources(Dummy.class) | ||
.inNamespace("default") | ||
.withLabel("app", "test-operator") | ||
.inform(myEventHandler, 30 * 1000L); | ||
|
||
informer.close(); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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