Skip to content

Commit 7666d73

Browse files
chore: Version CRD and HbaseClusterConfig (#624)
* chore: Remove separate CRD crate * chore: Remove redundant Clippy allow attributes * chore: Version HbaseCluster * docs: Fix invalid rustdoc reference * chore: Version HbaseClusterConfig * chore: Move HbaseCluster impl blocks * chore: Apply suggestion Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --------- Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
1 parent 4058b98 commit 7666d73

File tree

19 files changed

+2630
-1479
lines changed

19 files changed

+2630
-1479
lines changed

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 5 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,10 @@ edition = "2021"
1010
repository = "https://github.com/stackabletech/hbase-operator"
1111

1212
[workspace.dependencies]
13+
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
15+
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
16+
1317
anyhow = "1.0"
1418
built = { version = "0.7", features = ["chrono", "git2"] }
1519
clap = "4.5"
@@ -23,8 +27,6 @@ serde_json = "1.0"
2327
serde_yaml = "0.9"
2428
shell-escape = "0.1"
2529
snafu = "0.8"
26-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
27-
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
2830
strum = { version = "0.26", features = ["derive"] }
2931
tokio = { version = "1.40", features = ["full"] }
3032
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 & 24 deletions
This file was deleted.

rust/operator-binary/Cargo.toml

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

1111
[dependencies]
12-
stackable-hbase-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
1618
const_format.workspace = true
1719
fnv.workspace = true
1820
futures.workspace = true
19-
product-config.workspace = true
21+
indoc.workspace = true
2022
serde.workspace = true
23+
serde_json.workspace = true
24+
shell-escape.workspace = true
2125
snafu.workspace = true
22-
stackable-operator.workspace = true
2326
strum.workspace = true
2427
tokio.workspace = true
2528
tracing.workspace = true

rust/operator-binary/src/config/jvm.rs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
use snafu::{OptionExt, ResultExt, Snafu};
2-
use stackable_hbase_crd::{
3-
AnyServiceConfig, HbaseCluster, HbaseRole, CONFIG_DIR_NAME, JVM_SECURITY_PROPERTIES_FILE,
4-
METRICS_PORT,
5-
};
62
use stackable_operator::{
73
memory::{BinaryMultiple, MemoryQuantity},
84
role_utils::{self, JvmArgumentOverrides},
95
};
106

7+
use crate::crd::{
8+
v1alpha1, AnyServiceConfig, HbaseRole, CONFIG_DIR_NAME, JVM_SECURITY_PROPERTIES_FILE,
9+
METRICS_PORT,
10+
};
11+
1112
const JAVA_HEAP_FACTOR: f32 = 0.8;
1213

1314
#[derive(Snafu, Debug)]
@@ -49,7 +50,7 @@ pub fn construct_global_jvm_args(kerberos_enabled: bool) -> String {
4950
/// JVM arguments that are specifically for the role (server), so will *not* be used e.g. by CLI tools.
5051
/// Heap settings are excluded, as they go into `HBASE_HEAPSIZE`.
5152
pub fn construct_role_specific_non_heap_jvm_args(
52-
hbase: &HbaseCluster,
53+
hbase: &v1alpha1::HbaseCluster,
5354
hbase_role: &HbaseRole,
5455
role_group: &str,
5556
product_version: &str,
@@ -142,9 +143,8 @@ fn is_heap_jvm_argument(jvm_argument: &str) -> bool {
142143

143144
#[cfg(test)]
144145
mod tests {
145-
use stackable_hbase_crd::{HbaseCluster, HbaseRole};
146-
147146
use super::*;
147+
use crate::crd::{v1alpha1, HbaseRole};
148148

149149
#[test]
150150
fn test_construct_jvm_arguments_defaults() {
@@ -260,8 +260,15 @@ mod tests {
260260

261261
fn construct_boilerplate(
262262
hbase_cluster: &str,
263-
) -> (HbaseCluster, HbaseRole, AnyServiceConfig, String, String) {
264-
let hbase: HbaseCluster = serde_yaml::from_str(hbase_cluster).expect("illegal test input");
263+
) -> (
264+
v1alpha1::HbaseCluster,
265+
HbaseRole,
266+
AnyServiceConfig,
267+
String,
268+
String,
269+
) {
270+
let hbase: v1alpha1::HbaseCluster =
271+
serde_yaml::from_str(hbase_cluster).expect("illegal test input");
265272

266273
let hbase_role = HbaseRole::RegionServer;
267274
let merged_config = hbase

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use stackable_operator::{
55
k8s_openapi::api::core::v1::{PodAffinity, PodAntiAffinity},
66
};
77

8-
use crate::{HbaseRole, APP_NAME};
8+
use crate::crd::{HbaseRole, APP_NAME};
99

1010
pub fn get_affinity(
1111
cluster_name: &str,
@@ -91,7 +91,7 @@ mod tests {
9191
};
9292

9393
use super::*;
94-
use crate::HbaseCluster;
94+
use crate::crd::v1alpha1;
9595

9696
#[rstest]
9797
#[case(HbaseRole::Master)]
@@ -122,7 +122,8 @@ mod tests {
122122
default:
123123
replicas: 1
124124
"#;
125-
let hbase: HbaseCluster = serde_yaml::from_str(input).expect("illegal test input");
125+
let hbase: v1alpha1::HbaseCluster =
126+
serde_yaml::from_str(input).expect("illegal test input");
126127
let affinity = hbase
127128
.merged_config(
128129
&role,

0 commit comments

Comments
 (0)