Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Add re-exports for `stackable-telemetry` and `stackable-versioned` ([#1007]).
- Add new features: `default`, `full`, `telemetry`, and `versioned` ([#1007]).

[#1007]: https://github.com/stackabletech/operator-rs/pull/1007

## [0.91.0] - 2025-04-08

### Changed
Expand Down
7 changes: 6 additions & 1 deletion crates/stackable-operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ edition.workspace = true
repository.workspace = true

[features]
full = ["time", "telemetry", "versioned"]
default = ["telemetry", "versioned"]
time = ["dep:time"]
telemetry = []
versioned = []

[dependencies]
stackable-telemetry = { path = "../stackable-telemetry", features = ["clap"]}
stackable-telemetry = { path = "../stackable-telemetry", features = ["clap"] }
stackable-versioned = { path = "../stackable-versioned", features = ["k8s"] }
stackable-operator-derive = { path = "../stackable-operator-derive" }
stackable-shared = { path = "../stackable-shared" }

Expand Down
28 changes: 19 additions & 9 deletions crates/stackable-operator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//! ## Crate Features
//!
//! - `default` enables a default set of features which most operators need.
//! - `full` enables all available features.
//! - `time` enables interoperability between [`time::Duration`] and the `time` crate.
//! - `telemetry` enables various helpers for emitting telemetry data.
//! - `versioned` enables the macro for CRD versioning.

pub mod builder;
pub mod cli;
pub mod client;
Expand All @@ -21,14 +29,16 @@ pub mod time;
pub mod utils;
pub mod validation;

// External re-exports
pub use k8s_openapi;
pub use kube;
pub use schemars;
// Internal re-exports
// TODO (@Techassi): Ideally we would want webhook and certs exported here as
// well, but that would require some restructuring of crates.
pub use stackable_shared as shared;
pub use stackable_shared::{crd::CustomResourceExt, yaml::YamlSchema};

pub mod shared {
pub use stackable_shared::*;
}

// External re-exports
pub use ::k8s_openapi;
pub use ::kube;
pub use ::schemars;
#[cfg(feature = "telemetry")]
pub use stackable_telemetry as telemetry;
#[cfg(feature = "versioned")]
pub use stackable_versioned as versioned;
7 changes: 5 additions & 2 deletions crates/stackable-versioned-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ especially for CustomResourceDefinitions (CRDs). These features are
completely opt-in. You need to enable the `k8s` feature (which enables
optional dependencies) and use the `k8s()` parameter in the macro.

You need to derive both [`kube::CustomResource`] and [`schemars::JsonSchema`].
You need to derive both [`kube::CustomResource`] and [`schemars::JsonSchema`][1].

```
# use stackable_versioned_macros::versioned;
Expand Down Expand Up @@ -730,7 +730,7 @@ println!("{}", serde_yaml::to_string(&merged_crd).unwrap());
# }
```

The generated `merged_crd` method is a wrapper around [kube's `merge_crds`][1]
The generated `merged_crd` method is a wrapper around [kube's `merge_crds`][2]
function. It automatically calls the `crd` methods of the CRD in all of its
versions and additionally provides a strongly typed selector for the stored
API version.
Expand Down Expand Up @@ -846,6 +846,9 @@ mod v1 {
It is possible to include structs and enums which are not CRDs. They are instead
versioned as expected (without adding the `#[kube]` derive macro and generating
code to merge CRD versions).

[1]: https://docs.rs/schemars/latest/schemars/derive.JsonSchema.html
[2]: https://docs.rs/kube/latest/kube/core/crd/fn.merge_crds.html
"#
)]
#[proc_macro_attribute]
Expand Down
Loading