Skip to content

Commit 8657ee3

Browse files
committed
docs: update samples
1 parent bb0a6d8 commit 8657ee3

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

README.md

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Build Kubernetes Operators in Java without hassle. Inspired by [operator-sdk](ht
1515

1616
#### Features
1717
* Framework for handling Kubernetes API events
18-
* Registering Custom Resource watches
18+
* Automatic registration of Custom Resource watches
1919
* Retry action on failure
20-
* Smart event scheduling (only handle latest event for the same resource)
20+
* Smart event scheduling (only handle the latest event for the same resource)
2121

2222
Check out this [blog post](https://blog.container-solutions.com/a-deep-dive-into-the-java-operator-sdk)
2323
about the non-trivial yet common problems needed to be solved for every operator.
@@ -52,6 +52,7 @@ Implemented with and without Spring Boot support. The two samples share the comm
5252
* *webserver*: More realistic example creating an nginx webserver from a Custom Resource containing html code.
5353
* *mysql-schema*: Operator managing schemas in a MySQL database
5454
* *spring-boot-plain/auto-config*: Samples showing integration with Spring Boot.
55+
* *quarkus*: Minimal application showing automatic configuration / injection of Operator / Controllers.
5556

5657
Add [dependency](https://search.maven.org/search?q=a:operator-framework) to your project with Maven:
5758

@@ -89,7 +90,7 @@ public class Runner {
8990
The Controller implements the business logic and describes all the classes needed to handle the CRD.
9091

9192
```java
92-
@Controller(crdName = "webservers.sample.javaoperatorsdk")
93+
@Controller
9394
public class WebServerController implements ResourceController<WebServer> {
9495

9596
@Override
@@ -110,28 +111,9 @@ public class WebServerController implements ResourceController<WebServer> {
110111
A sample custom resource POJO representation
111112

112113
```java
113-
public class WebServer extends CustomResource {
114-
115-
private WebServerSpec spec;
116-
117-
private WebServerStatus status;
118-
119-
public WebServerSpec getSpec() {
120-
return spec;
121-
}
122-
123-
public void setSpec(WebServerSpec spec) {
124-
this.spec = spec;
125-
}
126-
127-
public WebServerStatus getStatus() {
128-
return status;
129-
}
130-
131-
public void setStatus(WebServerStatus status) {
132-
this.status = status;
133-
}
134-
}
114+
@Group("sample.javaoperatorsdk")
115+
@Version("v1")
116+
public class WebServer extends CustomResource<WebServerSpec, WebServerStatus> {}
135117

136118
public class WebServerSpec {
137119

@@ -183,7 +165,6 @@ public class QuarkusOperator implements QuarkusApplication {
183165
public int run(String... args) throws Exception {
184166
final var config = configuration.getConfigurationFor(new CustomServiceController(client));
185167
System.out.println("CR class: " + config.getCustomResourceClass());
186-
System.out.println("Doneable class = " + config.getDoneableClass());
187168

188169
Quarkus.waitForExit();
189170
return 0;

0 commit comments

Comments
 (0)