@@ -29,7 +29,7 @@ mod utils;
29
29
/// example, `#[automatically_derived]` and `#[allow(deprecated)]` are removed
30
30
/// in most examples to reduce visual clutter.
31
31
///
32
- /// ## Declaring Versions
32
+ /// <div class="warning">
33
33
///
34
34
/// It is **important** to note that this macro must be placed before any other
35
35
/// (derive) macros and attributes. Macros supplied before the versioned macro
@@ -38,16 +38,29 @@ mod utils;
38
38
/// attributes are applied to the generated versioned instances of the
39
39
/// container.
40
40
///
41
+ /// </div>
42
+ ///
43
+ /// ## Declaring Versions
44
+ ///
41
45
/// Before any of the fields or variants can be versioned, versions need to be
42
46
/// declared at the container level. Each version currently supports two
43
47
/// parameters: `name` and the `deprecated` flag. The `name` must be a valid
44
48
/// (and supported) format.
45
49
///
46
50
/// <div class="warning">
51
+ ///
47
52
/// Currently, only Kubernetes API versions are supported. The macro checks each
48
53
/// declared version and reports any error encountered during parsing.
54
+ ///
49
55
/// </div>
50
56
///
57
+ /// It should be noted that the defined struct always represents the **latest**
58
+ /// version, eg: when defining three versions `v1alpha1`, `v1beta1`, and `v1`,
59
+ /// the struct will describe the structure of the data in `v1`. This behaviour
60
+ /// is especially noticeable in the [`changed()`](#changed-action) action which
61
+ /// works "backwards" by describing how a field looked before the current
62
+ /// (latest) version.
63
+ ///
51
64
/// ```
52
65
/// # use stackable_versioned_macros::versioned;
53
66
/// #[versioned(version(name = "v1alpha1"))]
@@ -252,12 +265,6 @@ mod utils;
252
265
/// }
253
266
/// ```
254
267
///
255
- /// <div class="warning">
256
- /// It is planned to move the <code>preserve_module</code> flag into the
257
- /// <code>options()</code> argument list, but currently seems tricky to
258
- /// implement.
259
- /// </div>
260
- ///
261
268
/// ## Item Actions
262
269
///
263
270
/// This crate currently supports three different item actions. Items can
@@ -601,6 +608,11 @@ println!("{}", serde_yaml::to_string(&merged_crd).unwrap());
601
608
# }
602
609
```
603
610
611
+ The generated `merged_crd` method is a wrapper around [kube's `merge_crds`][1]
612
+ function. It automatically calls the `crd` methods of the CRD in all of its
613
+ versions and additionally provides a strongly typed selector for the stored
614
+ API version.
615
+
604
616
Currently, the following arguments are supported:
605
617
606
618
- `group`: Set the group of the CR object, usually the domain of the company.
0 commit comments