Skip to content

Commit aaf8445

Browse files
committed
chore: Merge branch 'main' into chore/deprecate-initialize-logging
2 parents 697a7f3 + 650ac95 commit aaf8445

File tree

10 files changed

+137
-32
lines changed

10 files changed

+137
-32
lines changed

Cargo.lock

Lines changed: 33 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ itertools = "0.14.0"
3333
json-patch = "4.0.0"
3434
k8s-openapi = { version = "0.24.0", default-features = false, features = ["schemars", "v1_32"] }
3535
# 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
36-
kube = { version = "0.99.0", default-features = false, features = ["client", "jsonpatch", "runtime", "derive", "rustls-tls"] }
36+
kube = { version = "0.99.0", default-features = false, features = ["client", "jsonpatch", "runtime", "derive", "rustls-tls", "ring"] }
3737
opentelemetry = "0.23.0"
3838
opentelemetry_sdk = { version = "0.23.0", features = ["rt-tokio"] }
3939
opentelemetry-appender-tracing = "0.4.0"

crates/stackable-operator/CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Add Deployments to `ClusterResource`s ([#992]).
10+
711
### Changed
812

9-
- Deprecate `stackable_operator::logging::initialize_logging()`. It's recommended to use `stackable-telemetry` instead ([#950]).
13+
- Deprecate `stackable_operator::logging::initialize_logging()`. It's recommended to use `stackable-telemetry` instead ([#950], [#989]).
1014

1115
[#950]: https://github.com/stackabletech/operator-rs/pull/950
16+
[#989]: https://github.com/stackabletech/operator-rs/pull/989
17+
[#992]: https://github.com/stackabletech/operator-rs/pull/992
18+
19+
## [0.87.5] - 2025-03-19
20+
21+
### Fixed
22+
23+
- Enable the `kube/ring` feature to use ring as the crypto provider for `rustls`. This will
24+
otherwise cause runtime errors which result in panics ([#988]).
25+
26+
[#988]: https://github.com/stackabletech/operator-rs/pull/988
1227

1328
## [0.87.4] - 2025-03-17
1429

crates/stackable-operator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "stackable-operator"
33
description = "Stackable Operator Framework"
4-
version = "0.87.4"
4+
version = "0.87.5"
55
authors.workspace = true
66
license.workspace = true
77
edition.workspace = true

crates/stackable-operator/src/cluster_resources.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use std::{
77

88
use k8s_openapi::{
99
api::{
10-
apps::v1::{DaemonSet, DaemonSetSpec, StatefulSet, StatefulSetSpec},
10+
apps::v1::{
11+
DaemonSet, DaemonSetSpec, Deployment, DeploymentSpec, StatefulSet, StatefulSetSpec,
12+
},
1113
batch::v1::Job,
1214
core::v1::{
1315
ConfigMap, ObjectReference, PodSpec, PodTemplateSpec, Secret, Service, ServiceAccount,
@@ -279,6 +281,29 @@ impl ClusterResource for DaemonSet {
279281
}
280282
}
281283

284+
impl ClusterResource for Deployment {
285+
fn maybe_mutate(self, strategy: &ClusterResourceApplyStrategy) -> Self {
286+
match strategy {
287+
ClusterResourceApplyStrategy::ClusterStopped => Deployment {
288+
spec: Some(DeploymentSpec {
289+
replicas: Some(0),
290+
..self.spec.unwrap_or_default()
291+
}),
292+
..self
293+
},
294+
ClusterResourceApplyStrategy::Default
295+
| ClusterResourceApplyStrategy::ReconciliationPaused
296+
| ClusterResourceApplyStrategy::NoApply => self,
297+
}
298+
}
299+
300+
fn pod_spec(&self) -> Option<&PodSpec> {
301+
self.spec
302+
.as_ref()
303+
.and_then(|spec| spec.template.spec.as_ref())
304+
}
305+
}
306+
282307
/// A structure containing the cluster resources.
283308
///
284309
/// Cluster resources can be added and orphaned resources are deleted. A cluster resource becomes
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[versioned(version(name = "v1alpha1"), version(name = "v1"))]
2+
// ---
3+
pub struct Foo<T = String>
4+
where
5+
T: Default,
6+
{
7+
bar: T,
8+
baz: u8,
9+
}

crates/stackable-versioned-macros/fixtures/snapshots/stackable_versioned_macros__test__default_snapshots@generics_defaults.rs.snap

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-versioned-macros/src/codegen/container/enum.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ pub(crate) struct Enum {
104104
impl Enum {
105105
/// Generates code for the enum definition.
106106
pub(crate) fn generate_definition(&self, version: &VersionDefinition) -> TokenStream {
107-
let (_, type_generics, where_clause) = self.generics.split_for_impl();
107+
let where_clause = self.generics.where_clause.as_ref();
108+
let type_generics = &self.generics;
109+
108110
let original_attributes = &self.common.original_attributes;
109111
let ident = &self.common.idents.original;
110112
let version_docs = &version.docs;

crates/stackable-versioned-macros/src/codegen/container/struct.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ pub(crate) struct Struct {
135135
impl Struct {
136136
/// Generates code for the struct definition.
137137
pub(crate) fn generate_definition(&self, version: &VersionDefinition) -> TokenStream {
138-
let (_, type_generics, where_clause) = self.generics.split_for_impl();
138+
let where_clause = self.generics.where_clause.as_ref();
139+
let type_generics = &self.generics;
140+
139141
let original_attributes = &self.common.original_attributes;
140142
let ident = &self.common.idents.original;
141143
let version_docs = &version.docs;

crates/stackable-versioned/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Fixed
8+
9+
- Correctly emit generic type parameter defaults in enum/struct definition blocks ([#991]).
10+
11+
[#991]: https://github.com/stackabletech/operator-rs/pull/991
12+
713
## [0.7.0] - 2025-03-17
814

915
### Changed

0 commit comments

Comments
 (0)