You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ UNRELEASED
12
12
- Replaced `kube::Error::RequestValidation(String)` variant with `kube::Error::BuildRequest(kube::core::request::Error)`. This variant includes possible errors when building an HTTP request as described above, and contains errors that was previously grouped under `kube::Error::SerdeError` and `kube::Error::HttpError`.
13
13
- Removed `impl From<T> for kube::Error` for the following types: `std::io::Error`, `hyper::Error`, `tower::BoxError`, `std::string::FromUtf8Error`, `http::Error`, `http::uri::InvalidUri`, `serde_json::Error`, `openssl::error::ErrorStack`, `kube::core::Error`, `kube::error::ConfigError`, `kube::error::DisoveryError`, `kube::error::OAuthError`.
14
14
- Changed variants of error enums in `kube::runtime`. Replaced `snafu` with `thiserror`.
15
-
* BREAKING: Replaced feature `kube-runtime/schema` with attribute `#[kube(derive_schema)]` - #690
16
-
- If you currently disable default `kube-runtime` default features to avoid this issue, add `#[kube(derive_schema = false)]` to your spec struct instead
15
+
* BREAKING: Replaced feature `kube-runtime/schema` with attribute `#[kube(schema_mode)]` - #690
16
+
- If you currently disable default `kube-runtime` default features to avoid automatic schema generation, add `#[kube(schema_mode = "disabled")]` to your spec struct instead
Copy file name to clipboardExpand all lines: kube-derive/src/lib.rs
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -111,12 +111,22 @@ mod custom_resource;
111
111
/// Adding `#[kube(derive = "PartialEq")]` is required if you want your generated
112
112
/// top level type to be able to `#[derive(PartialEq)]`
113
113
///
114
-
/// ### `#[kube(derive_schema = false)]`
115
-
/// Disables the automatic `#[derive(JsonSchema)]` on the top level generated type.
114
+
/// ### `#[kube(schema_mode = "mode")]`
115
+
/// Defines whether the `JsonSchema` of the top level generated type should be used when generating a `CustomResourceDefinition`.
116
116
///
117
-
/// This can be used to provide a completely custom schema, or to interact with third-party custom resources,
117
+
/// Legal values:
118
+
/// - `"derived"`: A `JsonSchema` implementation is automatically derived
119
+
/// - `"custom"`: `JsonSchema` is not derived, but used when creating the `CustomResource` object
120
+
/// - `"disabled"`: No `JsonSchema` is used
121
+
///
122
+
/// This can be used to provide a completely custom schema, or to interact with third-party custom resources
118
123
/// where you are not responsible for installing the `CustomResourceDefinition`.
119
124
///
125
+
/// Defaults to `"disabled"` when `apiextensions = "v1beta1"`, otherwise `"derived"`.
126
+
///
127
+
/// NOTE: `apiextensions = "v1"` `CustomResourceDefinition`s require a schema. If `schema_mode = "disabled"` then
128
+
/// `Self::crd()` will not be installable into the cluster as-is.
129
+
///
120
130
/// ### `#[kube(scale = r#"json"#)]`
121
131
/// Allow customizing the scale struct for the [scale subresource](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#subresources).
0 commit comments