Skip to content

Commit a9b0475

Browse files
committed
chore: version the crd
1 parent 6bbdbe6 commit a9b0475

File tree

8 files changed

+145
-143
lines changed

8 files changed

+145
-143
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use stackable_operator::{
33
k8s_openapi::api::core::v1::PodAntiAffinity,
44
};
55

6-
use crate::crd::{v1alpha1::ZookeeperRole, APP_NAME};
6+
use crate::crd::{ZookeeperRole, APP_NAME};
77

88
pub fn get_affinity(cluster_name: &str, role: &ZookeeperRole) -> StackableAffinityFragment {
99
let affinity_between_role_pods =

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

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use stackable_operator::{
55
commons::authentication::{AuthenticationClass, AuthenticationClassProvider},
66
schemars::{self, JsonSchema},
77
};
8+
use stackable_versioned::versioned;
89

910
use crate::crd::ObjectRef;
1011

@@ -29,19 +30,22 @@ pub enum Error {
2930
},
3031
}
3132

32-
#[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)]
33-
#[serde(rename_all = "camelCase")]
34-
pub struct ZookeeperAuthentication {
35-
/// The [AuthenticationClass](https://docs.stackable.tech/home/stable/concepts/authentication) to use.
36-
///
37-
/// ## mTLS
38-
///
39-
/// Only affects client connections. This setting controls:
40-
/// - If clients need to authenticate themselves against the server via TLS
41-
/// - Which ca.crt to use when validating the provided client certs
42-
///
43-
/// This will override the server TLS settings (if set) in `spec.clusterConfig.tls.serverSecretClass`.
44-
pub authentication_class: String,
33+
#[versioned(version(name = "v1alpha1"))]
34+
pub mod versioned {
35+
#[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)]
36+
#[serde(rename_all = "camelCase")]
37+
pub struct ZookeeperAuthentication {
38+
/// The [AuthenticationClass](https://docs.stackable.tech/home/stable/concepts/authentication) to use.
39+
///
40+
/// ## mTLS
41+
///
42+
/// Only affects client connections. This setting controls:
43+
/// - If clients need to authenticate themselves against the server via TLS
44+
/// - Which ca.crt to use when validating the provided client certs
45+
///
46+
/// This will override the server TLS settings (if set) in `spec.clusterConfig.tls.serverSecretClass`.
47+
pub authentication_class: String,
48+
}
4549
}
4650

4751
#[derive(Clone, Debug)]
@@ -99,7 +103,7 @@ impl ResolvedAuthenticationClasses {
99103
/// - Validation failed
100104
pub async fn resolve_authentication_classes(
101105
client: &Client,
102-
auth_classes: &Vec<ZookeeperAuthentication>,
106+
auth_classes: &Vec<v1alpha1::ZookeeperAuthentication>,
103107
) -> Result<ResolvedAuthenticationClasses, Error> {
104108
let mut resolved_authentication_classes: Vec<AuthenticationClass> = vec![];
105109

0 commit comments

Comments
 (0)