Skip to content

Commit c91f0b3

Browse files
committed
feat!: Re-export stackable-certs and stackable-webhook crates
1 parent 958f62f commit c91f0b3

File tree

24 files changed

+59
-29
lines changed

24 files changed

+59
-29
lines changed

Cargo.lock

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

crates/stackable-certs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ default = []
1111
rustls = ["dep:tokio-rustls"]
1212

1313
[dependencies]
14-
stackable-operator = { path = "../stackable-operator" }
14+
stackable-shared = { path = "../stackable-shared" }
1515

1616
const-oid.workspace = true
1717
ecdsa.workspace = true

crates/stackable-certs/src/ca/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use stackable_operator::time::Duration;
1+
use stackable_shared::time::Duration;
22

33
/// The default CA validity time span of one hour (3600 seconds).
44
pub const DEFAULT_CA_VALIDITY: Duration = Duration::from_hours_unchecked(1);

crates/stackable-certs/src/ca/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use std::{fmt::Debug, str::FromStr};
44

55
use const_oid::db::rfc5280::{ID_KP_CLIENT_AUTH, ID_KP_SERVER_AUTH};
66
use k8s_openapi::api::core::v1::Secret;
7-
use kube::runtime::reflector::ObjectRef;
7+
use kube::{Api, Client, runtime::reflector::ObjectRef};
88
use snafu::{OptionExt, ResultExt, Snafu};
9-
use stackable_operator::{client::Client, commons::secret::SecretReference, time::Duration};
9+
use stackable_shared::{commons::secret::SecretReference, time::Duration};
1010
use tracing::{debug, instrument};
1111
use x509_cert::{
1212
Certificate,
@@ -454,15 +454,15 @@ where
454454
/// Create a [`CertificateAuthority`] from a Kubernetes [`SecretReference`].
455455
#[instrument(
456456
name = "create_certificate_authority_from_k8s_secret_ref",
457-
skip(secret_ref, client)
457+
skip(client)
458458
)]
459459
pub async fn from_secret_ref(
460460
secret_ref: &SecretReference,
461461
key_certificate: &str,
462462
key_private_key: &str,
463-
client: &Client,
463+
client: Client,
464464
) -> Result<Self, SecretError<S::Error>> {
465-
let secret_api = client.get_api::<Secret>(&secret_ref.namespace);
465+
let secret_api = Api::namespaced(client, &secret_ref.namespace);
466466
let secret = secret_api
467467
.get(&secret_ref.name)
468468
.await

crates/stackable-operator/CHANGELOG.md

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

55
## [Unreleased]
66

7+
### Added
8+
9+
- Re-export `stackable-certs` and `stackable-webhook` crates ([#XXXX]).
10+
11+
### Changed
12+
13+
- BREAKING: Some modules have been moved into the `stackable-shared` crate, so that they can also be
14+
used in `stackable-certs` and `stackable-webhook` ([#XXXX]):
15+
- The module `stackable_operator::time` has moved to `stackable_operator::shared::time`
16+
- The module `stackable_operator::commons::secret` has moved to `stackable_operator::shared::commons::secret`
17+
18+
[#XXXX]: https://github.com/stackabletech/operator-rs/pull/XXXX
19+
720
## [0.94.0] - 2025-07-10
821

922
### Added

crates/stackable-operator/Cargo.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ edition.workspace = true
88
repository.workspace = true
99

1010
[features]
11-
full = ["time", "telemetry", "versioned"]
12-
default = ["telemetry", "versioned"]
11+
full = ["certs", "telemetry", "time", "versioned", "webhook"]
12+
default = ["telemetry", "time", "versioned"]
13+
14+
certs = ["dep:stackable-certs"]
15+
telemetry = ["dep:stackable-telemetry"]
1316
time = ["dep:time"]
14-
telemetry = []
15-
versioned = []
17+
versioned = ["dep:stackable-versioned"]
18+
webhook = ["dep:stackable-webhook"]
1619

1720
[dependencies]
21+
stackable-certs = { path = "../stackable-certs", optional = true }
1822
stackable-operator-derive = { path = "../stackable-operator-derive" }
1923
stackable-shared = { path = "../stackable-shared" }
20-
stackable-telemetry = { path = "../stackable-telemetry", features = ["clap"] }
21-
stackable-versioned = { path = "../stackable-versioned" }
24+
stackable-telemetry = { path = "../stackable-telemetry", optional = true, features = ["clap"] }
25+
stackable-versioned = { path = "../stackable-versioned", optional = true }
26+
stackable-webhook = { path = "../stackable-webhook", optional = true }
2227

2328
chrono.workspace = true
2429
clap.workspace = true

crates/stackable-operator/src/builder/pod/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use k8s_openapi::{
1010
apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::ObjectMeta},
1111
};
1212
use snafu::{OptionExt, ResultExt, Snafu};
13+
use stackable_shared::time::Duration;
1314

1415
use crate::{
1516
builder::{
@@ -25,7 +26,6 @@ use crate::{
2526
},
2627
},
2728
kvp::Labels,
28-
time::Duration,
2929
};
3030

3131
pub mod container;

crates/stackable-operator/src/builder/pod/volume.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ use k8s_openapi::{
99
apimachinery::pkg::api::resource::Quantity,
1010
};
1111
use snafu::{ResultExt, Snafu};
12+
use stackable_shared::time::Duration;
1213
use tracing::warn;
1314

1415
use crate::{
1516
builder::meta::ObjectMetaBuilder,
1617
kvp::{Annotation, AnnotationError, Annotations, LabelError, Labels},
17-
time::Duration,
1818
};
1919

2020
/// A builder to build [`Volume`] objects. May only contain one `volume_source`

crates/stackable-operator/src/commons/cache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use std::marker::PhantomData;
33
use educe::Educe;
44
use schemars::JsonSchema;
55
use serde::{Deserialize, Serialize};
6-
7-
use crate::time::Duration;
6+
use stackable_shared::time::Duration;
87

98
/// [`TtlCache`] with sensible defaults for a user information cache
109
pub type UserInformationCache = TtlCache<UserInformationCacheDefaults>;

crates/stackable-operator/src/commons/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ pub mod pdb;
99
pub mod product_image_selection;
1010
pub mod rbac;
1111
pub mod resources;
12-
pub mod secret;
1312
pub mod secret_class;
1413
pub mod tls_verification;

0 commit comments

Comments
 (0)