Skip to content

Commit 0fcfd88

Browse files
committed
fix: rename ResolvedAuth... to DereferencedAuthenticationClass.
1 parent 54cf547 commit 0fcfd88

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

rust/operator-binary/src/crd/authentication.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ pub mod versioned {
5151
}
5252

5353
#[derive(Clone, Debug)]
54-
/// Helper struct that contains resolved AuthenticationClasses to reduce network API calls.
55-
pub struct ResolvedAuthenticationClasses {
54+
/// Helper struct that contains dereferenced AuthenticationClasses to reduce network API calls.
55+
pub struct DereferencedAuthenticationClasses {
5656
resolved_authentication_classes: Vec<core::v1alpha1::AuthenticationClass>,
5757
}
5858

59-
impl ResolvedAuthenticationClasses {
59+
impl DereferencedAuthenticationClasses {
6060
/// Fetch the referenced AuthenticationClasses from the Kubernetes API without validating them.
6161
///
6262
/// Call [`Self::validate`] on the result to enforce the constraints documented there.
6363
pub async fn fetch_references(
6464
client: &Client,
6565
auth_classes: &Vec<v1alpha1::ZookeeperAuthentication>,
66-
) -> Result<ResolvedAuthenticationClasses, Error> {
66+
) -> Result<DereferencedAuthenticationClasses, Error> {
6767
let mut resolved_authentication_classes: Vec<core::v1alpha1::AuthenticationClass> = vec![];
6868

6969
for auth_class in auth_classes {
@@ -81,7 +81,7 @@ impl ResolvedAuthenticationClasses {
8181
);
8282
}
8383

84-
Ok(ResolvedAuthenticationClasses {
84+
Ok(DereferencedAuthenticationClasses {
8585
resolved_authentication_classes,
8686
})
8787
}
@@ -96,7 +96,7 @@ impl ResolvedAuthenticationClasses {
9696
})
9797
}
9898

99-
/// Validates the resolved AuthenticationClasses.
99+
/// Validates the dereferenced AuthenticationClasses.
100100
/// Currently errors out if:
101101
/// - More than one AuthenticationClass was provided
102102
/// - AuthenticationClass mechanism was not supported
@@ -125,7 +125,7 @@ impl ResolvedAuthenticationClasses {
125125

126126
/// USE ONLY IN TESTS! We can not put it behind `#[cfg(test)]` because of <https://github.com/rust-lang/cargo/issues/8379>
127127
pub fn new_for_tests() -> Self {
128-
ResolvedAuthenticationClasses {
128+
DereferencedAuthenticationClasses {
129129
resolved_authentication_classes: vec![],
130130
}
131131
}

rust/operator-binary/src/crd/security.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use stackable_operator::{
2626
};
2727

2828
use crate::{
29-
crd::{authentication::ResolvedAuthenticationClasses, tls, v1alpha1},
29+
crd::{authentication::DereferencedAuthenticationClasses, tls, v1alpha1},
3030
zk_controller::LISTENER_VOLUME_NAME,
3131
};
3232

@@ -51,7 +51,7 @@ pub enum Error {
5151

5252
/// Helper struct combining TLS settings for server and quorum with the resolved AuthenticationClasses
5353
pub struct ZookeeperSecurity {
54-
resolved_authentication_classes: ResolvedAuthenticationClasses,
54+
resolved_authentication_classes: DereferencedAuthenticationClasses,
5555
server_secret_class: Option<String>,
5656
quorum_secret_class: String,
5757
}
@@ -90,11 +90,11 @@ impl ZookeeperSecurity {
9090
pub const SYSTEM_TRUST_STORE_DIR: &'static str = "/etc/pki/java/cacerts";
9191

9292
/// Build a `ZookeeperSecurity` from a [`v1alpha1::ZookeeperCluster`] and already-resolved
93-
/// [`ResolvedAuthenticationClasses`]. Synchronous; intended to be called from the validate
93+
/// [`DereferencedAuthenticationClasses`]. Synchronous; intended to be called from the validate
9494
/// step of the controllers.
9595
pub fn new(
9696
zk: &v1alpha1::ZookeeperCluster,
97-
resolved_authentication_classes: ResolvedAuthenticationClasses,
97+
resolved_authentication_classes: DereferencedAuthenticationClasses,
9898
) -> Self {
9999
ZookeeperSecurity {
100100
resolved_authentication_classes,
@@ -351,7 +351,7 @@ impl ZookeeperSecurity {
351351
/// USE ONLY IN TESTS! We can not put it behind `#[cfg(test)]` because of <https://github.com/rust-lang/cargo/issues/8379>
352352
pub fn new_for_tests() -> Self {
353353
ZookeeperSecurity {
354-
resolved_authentication_classes: ResolvedAuthenticationClasses::new_for_tests(),
354+
resolved_authentication_classes: DereferencedAuthenticationClasses::new_for_tests(),
355355
server_secret_class: Some("tls".to_owned()),
356356
quorum_secret_class: "tls".to_string(),
357357
}

rust/operator-binary/src/zk_controller/dereference.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use snafu::{ResultExt, Snafu};
99
use stackable_operator::client::Client;
1010

1111
use crate::crd::{
12-
authentication::{self, ResolvedAuthenticationClasses},
12+
authentication::{self, DereferencedAuthenticationClasses},
1313
v1alpha1,
1414
};
1515

@@ -24,15 +24,15 @@ type Result<T, E = Error> = std::result::Result<T, E>;
2424
/// Kubernetes objects referenced from the [`v1alpha1::ZookeeperCluster`] spec, already fetched but
2525
/// not yet validated.
2626
pub struct DereferencedObjects {
27-
pub authentication_classes: ResolvedAuthenticationClasses,
27+
pub authentication_classes: DereferencedAuthenticationClasses,
2828
}
2929

3030
/// Fetches all Kubernetes objects referenced from the [`v1alpha1::ZookeeperCluster`] spec.
3131
pub async fn dereference(
3232
client: &Client,
3333
zk: &v1alpha1::ZookeeperCluster,
3434
) -> Result<DereferencedObjects> {
35-
let authentication_classes = ResolvedAuthenticationClasses::fetch_references(
35+
let authentication_classes = DereferencedAuthenticationClasses::fetch_references(
3636
client,
3737
&zk.spec.cluster_config.authentication,
3838
)

rust/operator-binary/src/znode_controller/dereference.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! The dereference step in the ZookeeperZnode controller.
22
//!
33
//! Fetches the parent [`v1alpha1::ZookeeperCluster`] referenced by the znode's
4-
//! `spec.clusterRef`, plus the [`ResolvedAuthenticationClasses`] of that cluster. Both Apply
4+
//! `spec.clusterRef`, plus the [`DereferencedAuthenticationClasses`] of that cluster. Both Apply
55
//! and Cleanup paths in `reconcile_znode` share this output. Synchronous validation of the
66
//! fetched objects happens in the validate step.
77
@@ -12,7 +12,7 @@ use stackable_operator::{
1212
};
1313

1414
use crate::crd::{
15-
authentication::{self, ResolvedAuthenticationClasses},
15+
authentication::{self, DereferencedAuthenticationClasses},
1616
v1alpha1,
1717
};
1818

@@ -42,7 +42,7 @@ type Result<T, E = Error> = std::result::Result<T, E>;
4242
/// Kubernetes objects referenced from the [`v1alpha1::ZookeeperZnode`] spec, already fetched.
4343
pub struct DereferencedObjects {
4444
pub zk: v1alpha1::ZookeeperCluster,
45-
pub authentication_classes: ResolvedAuthenticationClasses,
45+
pub authentication_classes: DereferencedAuthenticationClasses,
4646
}
4747

4848
/// Fetches all Kubernetes objects referenced from the [`v1alpha1::ZookeeperZnode`] spec.
@@ -52,7 +52,7 @@ pub async fn dereference(
5252
) -> Result<DereferencedObjects> {
5353
let zk = find_zk_of_znode(client, znode).await?;
5454

55-
let authentication_classes = ResolvedAuthenticationClasses::fetch_references(
55+
let authentication_classes = DereferencedAuthenticationClasses::fetch_references(
5656
client,
5757
&zk.spec.cluster_config.authentication,
5858
)

0 commit comments

Comments
 (0)