Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
713ca9c
chore: Import framework code from opensearch-operator
Techassi May 13, 2026
2563bd2
fix: make config_overrides public (#1210)
maltesander May 28, 2026
a31cd25
Fix/make role and group utils pub (#1212)
maltesander May 29, 2026
128e1af
main merge
razvan Jun 4, 2026
831e1ba
fix: make missing v2 framework utils pub (#1216)
maltesander Jun 5, 2026
46cd3f9
refactor: Add config file writers to v2 (#1217)
adwk67 Jun 5, 2026
de69410
fix: remove option part for properties writer (#1218)
maltesander Jun 9, 2026
451088f
Change KeyValueConfigOverrides to `BTreeMap<String, String>` (#1219)
siegfriedweber Jun 9, 2026
1e8099f
Make JvmArgumentOverrides mergeable (#1220)
siegfriedweber Jun 11, 2026
00b5d04
Add function to build a metrics Service name (#1221)
siegfriedweber Jun 15, 2026
a9fbbc8
Relax the length constraints of cluster, role and role group name (#1…
siegfriedweber Jun 15, 2026
bde2311
Fix: make rolegroup replicas optional (#1223)
maltesander Jun 16, 2026
c4ff8f5
chore(stackable-operator): Update changelog
siegfriedweber Jun 18, 2026
f3a0923
stackable-operator: Add feature test-support
siegfriedweber Jun 18, 2026
9fae8a6
Remove unnecessary Clippy hints
siegfriedweber Jun 18, 2026
f0a4027
Improve code style
siegfriedweber Jun 18, 2026
d98d95d
Use attributed string type for EnvVarName
siegfriedweber Jun 18, 2026
365ccb5
Allow expressions in the constant macro
siegfriedweber Jun 18, 2026
951b386
Add types for DaemonSetName and DeploymentName
siegfriedweber Jun 19, 2026
a728c7f
Add functions to create Prometheus labels and annotations
siegfriedweber Jun 19, 2026
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
217 changes: 121 additions & 96 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ insta = { version = "1.40", features = ["glob"] }
hyper = { version = "1.4.1", features = ["full"] }
hyper-util = "0.1.8"
itertools = "0.14.0"
java-properties = "2.0"
json-patch = "4.0.0"
k8s-openapi = { version = "0.27.0", default-features = false, features = ["schemars", "v1_35"] }
# We use rustls instead of openssl for easier portability, e.g. so that we can build stackablectl without the need to vendor (build from source) openssl
Expand Down Expand Up @@ -86,8 +87,10 @@ tracing-opentelemetry = "0.33.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] }
trybuild = "1.0.99"
url = { version = "2.5.2", features = ["serde"] }
uuid = "1.23"
winnow = "1.0.3"
x509-cert = { version = "0.2.5", features = ["builder"] }
xml = "1.3"
zeroize = "1.8.1"

[workspace.lints.clippy]
Expand Down
2 changes: 2 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.

- Add `Client::{get_feature_gates,get_enabled_feature_gates,get_disabled_feature_gates}` associated
functions to retrieve all, enabled, or disabled feature gates from the Kubernetes apiserver ([#1207], [#1208]).
- Add a new `v2` module that provides more type-safe variants of the existing functions ([#1225]).

### Changed

Expand All @@ -16,6 +17,7 @@ All notable changes to this project will be documented in this file.
[#1206]: https://github.com/stackabletech/operator-rs/pull/1206
[#1207]: https://github.com/stackabletech/operator-rs/pull/1207
[#1208]: https://github.com/stackabletech/operator-rs/pull/1208
[#1225]: https://github.com/stackabletech/operator-rs/pull/1225

## [0.111.1] - 2026-04-28

Expand Down
6 changes: 5 additions & 1 deletion crates/stackable-operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ educe.workspace = true
futures.workspace = true
http.workspace = true
indexmap.workspace = true
java-properties.workspace = true
jiff.workspace = true
json-patch.workspace = true
json-patch = { workspace = true, features = ["schemars"] }
k8s-openapi.workspace = true
kube.workspace = true
product-config.workspace = true
Expand All @@ -48,14 +49,17 @@ semver.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
serde.workspace = true
sha2.workspace = true
snafu.workspace = true
strum.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-appender.workspace = true
tracing-subscriber.workspace = true
url.workspace = true
uuid.workspace = true
winnow = { workspace = true, optional = true }
xml.workspace = true

[dev-dependencies]
indoc.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/stackable-operator/crds/Scaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ spec:

Upstream issues:

- https://github.com/kubernetes/kubernetes/issues/105533
- https://github.com/Arnavion/k8s-openapi/issues/136
- <https://github.com/kubernetes/kubernetes/issues/105533>
- <https://github.com/Arnavion/k8s-openapi/issues/136>
format: uint16
maximum: 65535.0
minimum: 0.0
Expand Down
4 changes: 2 additions & 2 deletions crates/stackable-operator/src/crd/scaler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub mod versioned {
///
/// Upstream issues:
///
/// - https://github.com/kubernetes/kubernetes/issues/105533
/// - https://github.com/Arnavion/k8s-openapi/issues/136
/// - <https://github.com/kubernetes/kubernetes/issues/105533>
/// - <https://github.com/Arnavion/k8s-openapi/issues/136>
pub replicas: u16,
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/stackable-operator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub mod role_utils;
pub mod status;
pub mod test_utils;
pub mod utils;
pub mod v2;
pub mod validation;

// External re-exports
Expand Down
4 changes: 4 additions & 0 deletions crates/stackable-operator/src/v2/builder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod meta;
pub mod pdb;
pub mod pod;
pub mod statefulset;
123 changes: 123 additions & 0 deletions crates/stackable-operator/src/v2/builder/meta.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
use crate::{
builder::meta::OwnerReferenceBuilder,
k8s_openapi::apimachinery::pkg::apis::meta::v1::OwnerReference,
kube::Resource,
v2::{HasName, HasUid},
};

/// Infallible variant of
/// [`crate::builder::meta::ObjectMetaBuilder::ownerreference_from_resource`]
pub fn ownerreference_from_resource(
resource: &(impl Resource<DynamicType = ()> + HasName + HasUid),
block_owner_deletion: Option<bool>,
controller: Option<bool>,
) -> OwnerReference {
OwnerReferenceBuilder::new()
// Set api_version, kind, name and additionally the UID if it exists.
.initialize_from_resource(resource)
// Ensure that the name is set.
.name(resource.to_name())
// Ensure that the UID is set.
.uid(resource.to_uid().to_string())
.block_owner_deletion_opt(block_owner_deletion)
.controller_opt(controller)
.build()
.expect(
"OwnerReference should be created because the resource has an api_version, kind, name \
and uid.",
)
}

#[cfg(test)]
mod tests {
use std::borrow::Cow;

use crate::{
k8s_openapi::apimachinery::pkg::apis::meta::v1::{ObjectMeta, OwnerReference},
kube::Resource,
v2::{HasName, HasUid, Uid, builder::meta::ownerreference_from_resource},
};

struct Cluster {
object_meta: ObjectMeta,
}

impl Cluster {
fn new() -> Self {
Self {
object_meta: ObjectMeta {
name: Some("cluster-name".to_owned()),
uid: Some("a6b89911-d48e-4328-88d6-b9251226583d".to_owned()),
..ObjectMeta::default()
},
}
}
}

impl Resource for Cluster {
type DynamicType = ();
type Scope = ();

fn kind(_dt: &Self::DynamicType) -> Cow<'_, str> {
Cow::from("kind")
}

fn group(_dt: &Self::DynamicType) -> Cow<'_, str> {
Cow::from("group")
}

fn version(_dt: &Self::DynamicType) -> Cow<'_, str> {
Cow::from("version")
}

fn plural(_dt: &Self::DynamicType) -> Cow<'_, str> {
Cow::from("plural")
}

fn meta(&self) -> &ObjectMeta {
&self.object_meta
}

fn meta_mut(&mut self) -> &mut ObjectMeta {
&mut self.object_meta
}
}

impl HasName for Cluster {
fn to_name(&self) -> String {
self.object_meta
.name
.clone()
.expect("should be set in Cluster::new")
}
}

impl HasUid for Cluster {
fn to_uid(&self) -> Uid {
Uid::from_str_unsafe(
&self
.object_meta
.uid
.clone()
.expect("should be set in Cluster::new"),
)
}
}

#[test]
fn test_ownerreference_from_resource() {
let actual_owner_reference =
ownerreference_from_resource(&Cluster::new(), Some(true), Some(true));

let expected_owner_reference = OwnerReference {
api_version: "group/version".to_owned(),
block_owner_deletion: Some(true),
controller: Some(true),
kind: "kind".to_owned(),
name: "cluster-name".to_owned(),
uid: "a6b89911-d48e-4328-88d6-b9251226583d".to_owned(),
};

assert_eq!(expected_owner_reference, actual_owner_reference);
}
}
Loading
Loading