Skip to content

Commit

Permalink
Add more information into readme about usage (#220)
Browse files Browse the repository at this point in the history
## Description

Readme update


## Type of Change

Please delete options that are not relevant.

* Documentation update

---------

Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys authored Jan 30, 2025
1 parent 112ee22 commit 8e7f1c5
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,48 @@ class Test {
class Test {
@Test
void testMethod() {
KubeResourceManager.get().createResourceWithWait(
new NamespaceBuilder().withNewMetadata().withName("test").endMetadata().build());
Namespace ns = new NamespaceBuilder().withNewMetadata().withName("test").endMetadata().build();
KubeResourceManager.get().createResourceWithWait(ns);
assertNotNull(KubeResourceManager.get().kubeCmdClient().get("namespace", "test"));

...

KubeResourceManager.get().deleteResource(ns);
}
}
//...
```
### Register `ResourceType` or `NamespacedResourceType` classes into `KubeResourceManager`
Include `test-frame-kubernetes` or for openshift specific resources include also `test-frame-openshift` package.
```xml
...
<dependency>
<groupId>io.skodjob</groupId>
<artifactId>test-frame-common</artifactId>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>io.skodjob</groupId>
<artifactId>test-frame-kubernetes</artifactId>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>io.skodjob</groupId>
<artifactId>test-frame-openshift</artifactId>
<version>0.10.0</version>
</dependency>
...
```
Then register resources which will be handled specifically by KubeResourceManager.
If resource is not registered then it is handled as common kubernetes resource with no special readiness check.
If you have any own resource for your operator then you can implement `ResourceType` interface with your specific readiness and handling.
```java
KubeResourceManager.get().setResourceTypes(
new NamespaceType(),
new JobType(),
new NetworkPolicyType()
new NetworkPolicyType(),
new SubsciptionType(),
new OperatorGroupType()
);
```

Expand Down

0 comments on commit 8e7f1c5

Please sign in to comment.