Skip to content

Commit 267f1a6

Browse files
Techassirazvan
andauthored
chore: Version CRD and DruidClusterConfig (#687)
* chore: Remove separate CRD crate * chore: Remove unused items, add #[cfg(test)] to some items * test: Fix unit tests * chore: Version DruidCluster * chore: Fix invalid references in doc comments * chore: Remove separate CRD crate * chore: Bump openssl to 0.10.70 to fix RUSTSEC-2025-0004 * chore: Version DruidClusterConfig * chore: Move DruidCluster impl blocks * make regenerate-nix --------- Co-authored-by: Razvan-Daniel Mihai <[email protected]>
1 parent 99cd01c commit 267f1a6

31 files changed

+2360
-1231
lines changed

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["rust/crd", "rust/operator-binary"]
2+
members = ["rust/operator-binary"]
33
resolver = "2"
44

55
[workspace.package]
@@ -10,6 +10,12 @@ edition = "2021"
1010
repository = "https://github.com/stackabletech/druid-operator"
1111

1212
[workspace.dependencies]
13+
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = [
14+
"k8s",
15+
], tag = "stackable-versioned-0.5.0" }
16+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
17+
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
18+
1319
anyhow = "1.0"
1420
built = { version = "0.7", features = ["chrono", "git2"] }
1521
clap = "4.5"
@@ -18,15 +24,13 @@ fnv = "1.0"
1824
futures = { version = "0.3", features = ["compat"] }
1925
indoc = "2.0"
2026
openssl = "0.10"
21-
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
2227
pin-project = "1.1"
2328
rstest = "0.24"
2429
semver = "1.0"
2530
serde = { version = "1.0", features = ["derive"] }
2631
serde_json = "1.0"
2732
serde_yaml = "0.9"
2833
snafu = "0.8"
29-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
3034
strum = { version = "0.26", features = ["derive"] }
3135
tokio = { version = "1.40", features = ["full"] }
3236
tracing = "0.1"

crate-hashes.json

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

rust/crd/Cargo.toml

Lines changed: 0 additions & 25 deletions
This file was deleted.

rust/operator-binary/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ repository.workspace = true
99
publish = false
1010

1111
[dependencies]
12-
stackable-druid-crd = { path = "../crd" }
12+
stackable-versioned.workspace = true
13+
stackable-operator.workspace = true
14+
product-config.workspace = true
1315

1416
anyhow.workspace = true
1517
clap.workspace = true
@@ -23,8 +25,6 @@ semver.workspace = true
2325
serde.workspace = true
2426
serde_json.workspace = true
2527
snafu.workspace = true
26-
stackable-operator.workspace = true
27-
product-config.workspace = true
2828
strum.workspace = true
2929
tokio.workspace = true
3030
tracing.workspace = true

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
use std::collections::BTreeMap;
22

33
use snafu::ResultExt;
4-
use stackable_druid_crd::security::{
5-
add_cert_to_trust_store_cmd, STACKABLE_TLS_DIR, TLS_STORE_PASSWORD,
6-
};
74
use stackable_operator::{
85
builder::pod::{container::ContainerBuilder, PodBuilder},
96
commons::authentication::ldap::AuthenticationProvider,
107
};
118

12-
use crate::authentication::{
13-
AddLdapVolumesSnafu, ConstructLdapEndpointUrlSnafu, Error, MissingLdapBindCredentialsSnafu,
9+
use crate::{
10+
authentication::{
11+
AddLdapVolumesSnafu, ConstructLdapEndpointUrlSnafu, Error, MissingLdapBindCredentialsSnafu,
12+
},
13+
crd::security::{add_cert_to_trust_store_cmd, STACKABLE_TLS_DIR, TLS_STORE_PASSWORD},
1414
};
1515

1616
fn add_authenticator_config(

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
use std::collections::BTreeMap;
22

33
use snafu::Snafu;
4-
use stackable_druid_crd::{
5-
authentication::{AuthenticationClassResolved, AuthenticationClassesResolved},
6-
security::{ESCALATOR_INTERNAL_CLIENT_PASSWORD_ENV, INTERNAL_INITIAL_CLIENT_PASSWORD_ENV},
7-
DruidCluster, DruidRole,
8-
};
94
use stackable_operator::{
105
builder::pod::{container::ContainerBuilder, PodBuilder},
116
commons::{
@@ -20,11 +15,18 @@ use stackable_operator::{
2015
k8s_openapi::api::core::v1::EnvVar,
2116
};
2217

18+
use crate::{
19+
crd::{
20+
authentication::{AuthenticationClassResolved, AuthenticationClassesResolved},
21+
security::{ESCALATOR_INTERNAL_CLIENT_PASSWORD_ENV, INTERNAL_INITIAL_CLIENT_PASSWORD_ENV},
22+
v1alpha1, DruidRole,
23+
},
24+
internal_secret::{build_shared_internal_secret_name, env_var_from_secret},
25+
};
26+
2327
pub mod ldap;
2428
pub mod oidc;
2529

26-
use crate::internal_secret::{build_shared_internal_secret_name, env_var_from_secret};
27-
2830
type Result<T, E = Error> = std::result::Result<T, E>;
2931

3032
#[derive(Snafu, Debug)]
@@ -159,7 +161,11 @@ impl DruidAuthenticationConfig {
159161
command
160162
}
161163

162-
pub fn get_env_var_mounts(&self, druid: &DruidCluster, role: &DruidRole) -> Vec<EnvVar> {
164+
pub fn get_env_var_mounts(
165+
&self,
166+
druid: &v1alpha1::DruidCluster,
167+
role: &DruidRole,
168+
) -> Vec<EnvVar> {
163169
let mut envs = vec![];
164170
let internal_secret_name = build_shared_internal_secret_name(druid);
165171
envs.push(env_var_from_secret(

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use std::collections::BTreeMap;
22

33
use snafu::ResultExt;
4-
use stackable_druid_crd::{
5-
security::add_cert_to_jvm_trust_store_cmd, DruidRole, COOKIE_PASSPHRASE_ENV,
6-
};
74
use stackable_operator::{
85
builder::pod::{container::ContainerBuilder, PodBuilder},
96
commons::authentication::oidc::{AuthenticationProvider, ClientAuthenticationOptions},
@@ -12,6 +9,7 @@ use stackable_operator::{
129

1310
use crate::{
1411
authentication::{AddOidcVolumesSnafu, ConstructOidcWellKnownUrlSnafu, Error},
12+
crd::{security::add_cert_to_jvm_trust_store_cmd, DruidRole, COOKIE_PASSPHRASE_ENV},
1513
internal_secret::env_var_from_secret,
1614
};
1715

rust/operator-binary/src/config.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
use indoc::formatdoc;
22
use snafu::{ResultExt, Snafu};
3-
use stackable_druid_crd::{
3+
use stackable_operator::memory::MemoryQuantity;
4+
5+
use crate::crd::{
46
DruidRole, JVM_SECURITY_PROPERTIES_FILE, LOG4J2_CONFIG, RW_CONFIG_DIRECTORY,
57
STACKABLE_TRUST_STORE, STACKABLE_TRUST_STORE_PASSWORD,
68
};
7-
use stackable_operator::memory::MemoryQuantity;
89

910
#[derive(Snafu, Debug)]
1011
pub enum Error {

0 commit comments

Comments
 (0)