Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
305 changes: 269 additions & 36 deletions Cargo.lock

Large diffs are not rendered by default.

1,156 changes: 1,051 additions & 105 deletions Cargo.nix

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["rust/crd", "rust/operator-binary"]
members = ["rust/operator-binary"]
resolver = "2"

[workspace.package]
Expand All @@ -24,6 +24,7 @@ serde_json = "1.0"
serde_yaml = "0.9"
snafu = "0.8"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" }
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
strum = { version = "0.26", features = ["derive"] }
tokio = { version = "1.40", features = ["full"] }
Expand Down
3 changes: 3 additions & 0 deletions crate-hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion deploy/helm/zookeeper-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@ spec:
kind: ZookeeperZnode
plural: zookeeperznodes
shortNames:
- zno
- znode
singular: zookeeperznode
scope: Namespaced
Expand Down
20 changes: 0 additions & 20 deletions rust/crd/Cargo.toml

This file was deleted.

48 changes: 0 additions & 48 deletions rust/crd/src/tls.rs

This file was deleted.

4 changes: 2 additions & 2 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ publish = false
build = "build.rs"

[dependencies]
stackable-zookeeper-crd = { path = "../crd" }

anyhow.workspace = true
clap.workspace = true
const_format.workspace = true
Expand All @@ -22,8 +20,10 @@ pin-project.workspace = true
product-config.workspace = true
semver.workspace = true
serde.workspace = true
serde_json.workspace = true
snafu.workspace = true
stackable-operator.workspace = true
stackable-versioned.workspace = true
strum.workspace = true
tokio-zookeeper.workspace = true
tokio.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/command.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use stackable_zookeeper_crd::{STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_RW_CONFIG_DIR};
use crate::crd::{STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_RW_CONFIG_DIR};

pub fn create_init_container_command_args() -> Vec<String> {
vec![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use stackable_operator::{
k8s_openapi::api::core::v1::PodAntiAffinity,
};

use crate::{ZookeeperRole, APP_NAME};
use crate::crd::{ZookeeperRole, APP_NAME};

pub fn get_affinity(cluster_name: &str, role: &ZookeeperRole) -> StackableAffinityFragment {
let affinity_between_role_pods =
Expand Down Expand Up @@ -37,7 +37,7 @@ mod tests {
role_utils::RoleGroupRef,
};

use crate::{ZookeeperCluster, ZookeeperRole};
use crate::crd::{affinity::ZookeeperRole, v1alpha1::ZookeeperCluster};

#[test]
fn test_affinity_defaults() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ use stackable_operator::{
commons::authentication::{AuthenticationClass, AuthenticationClassProvider},
schemars::{self, JsonSchema},
};
use stackable_versioned::versioned;

use crate::ObjectRef;
use crate::crd::ObjectRef;

const SUPPORTED_AUTHENTICATION_CLASS: [&str; 1] = ["TLS"];

Expand All @@ -29,19 +30,22 @@ pub enum Error {
},
}

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

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -99,7 +103,7 @@ impl ResolvedAuthenticationClasses {
/// - Validation failed
pub async fn resolve_authentication_classes(
client: &Client,
auth_classes: &Vec<ZookeeperAuthentication>,
auth_classes: &Vec<v1alpha1::ZookeeperAuthentication>,
) -> Result<ResolvedAuthenticationClasses, Error> {
let mut resolved_authentication_classes: Vec<AuthenticationClass> = vec![];

Expand Down
Loading