Skip to content

Commit aae2fdb

Browse files
committed
docs: add details on how to use the crd-generator
1 parent f7b07ef commit aae2fdb

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ handle more complex scenarios take a look on [event sources](https://csviri.medi
3333
#### Roadmap
3434
* Testing of the framework and all samples while running on a real cluster.
3535
* Generate a project skeleton
36-
* Generate Java classes from CRD defintion (and/or the other way around)
36+
* Generate Java classes from CRD
3737
* Integrate with Quarkus (including native image build)
3838
* Integrate with OLM (Operator Lifecycle Manager)
3939

@@ -164,7 +164,29 @@ public class WebServerSpec {
164164
}
165165
}
166166
```
167-
167+
168+
#### Automatic generation of CRDs
169+
170+
To automatically generate CRD manifests from your annotated Custom Resource classes, you only need
171+
to add the following dependency to your project:
172+
173+
```xml
174+
<dependency>
175+
<groupId>io.fabric8</groupId>
176+
<artifactId>crd-generator</artifactId>
177+
<scope>compile</scope>
178+
</dependency>
179+
```
180+
181+
The CRD will be generated in `target/classes/META-INF/fabric8` (or
182+
in `target/test-classes/META-INF/fabric8`, if you use the `test` scope) with the CRD name suffixed
183+
by the generated spec version. For example, a CR using the `java-operator-sdk.io` group with
184+
a `mycrs` plural form will result in 2 files:
185+
186+
- `mycrs.java-operator-sdk.io-v1.yml`
187+
- `mycrs.java-operator-sdk.io-v1beta1.yml`
188+
189+
168190
#### Quarkus
169191

170192
A [Quarkus](https://quarkus.io) extension is also provided to ease the development of Quarkus-based operators.

0 commit comments

Comments
 (0)