Skip to content

Commit 0fe526b

Browse files
committed
fix: move constants
1 parent 1027e54 commit 0fe526b

3 files changed

Lines changed: 22 additions & 19 deletions

File tree

rust/operator-binary/src/controller/build/properties/logging.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use stackable_operator::{
22
builder::configmap::ConfigMapBuilder,
3-
memory::BinaryMultiple,
3+
memory::{BinaryMultiple, MemoryQuantity},
44
product_logging::{
55
self,
66
spec::{
@@ -13,7 +13,12 @@ use stackable_operator::{
1313
use crate::{
1414
controller::build::properties::ConfigFileName,
1515
crd::{Container, v1alpha1},
16-
hbase_controller::{MAX_HBASE_LOG_FILES_SIZE, STACKABLE_LOG_DIR},
16+
};
17+
18+
pub const STACKABLE_LOG_DIR: &str = "/stackable/log";
19+
pub const MAX_HBASE_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity {
20+
value: 10.0,
21+
unit: BinaryMultiple::Mebi,
1722
};
1823

1924
const CONSOLE_CONVERSION_PATTERN: &str = "%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n";

rust/operator-binary/src/controller/validate.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ use crate::{
1616
controller::dereference::DereferencedObjects,
1717
crd::{HbaseRole, v1alpha1},
1818
hbase_controller::{
19-
CONTAINER_IMAGE_BASE_NAME, ValidatedCluster, ValidatedClusterConfig, ValidatedRoleConfig,
20-
ValidatedRoleGroupConfig,
19+
ValidatedCluster, ValidatedClusterConfig, ValidatedRoleConfig, ValidatedRoleGroupConfig,
2120
},
2221
kerberos::{
2322
self, kerberos_config_properties, kerberos_discovery_config_properties,
2423
kerberos_ssl_client_settings, kerberos_ssl_server_settings,
2524
},
2625
};
2726

27+
const CONTAINER_IMAGE_BASE_NAME: &str = "hbase";
28+
2829
#[derive(Snafu, Debug)]
2930
pub enum Error {
3031
#[snafu(display("failed to resolve product image"))]

rust/operator-binary/src/hbase_controller.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use stackable_operator::{
3535
},
3636
kvp::{Annotations, Label, LabelError, Labels, ObjectLabels},
3737
logging::controller::ReconcilerError,
38-
memory::{BinaryMultiple, MemoryQuantity},
3938
product_logging::{
4039
self,
4140
framework::LoggingError,
@@ -56,7 +55,10 @@ use strum::{EnumDiscriminants, IntoStaticStr};
5655

5756
use crate::{
5857
OPERATOR_NAME,
59-
controller::build::discovery::build_discovery_config_map,
58+
controller::build::{
59+
discovery::build_discovery_config_map,
60+
properties::logging::{MAX_HBASE_LOG_FILES_SIZE, STACKABLE_LOG_DIR},
61+
},
6062
crd::{
6163
APP_NAME, AnyServiceConfig, CONFIG_DIR_NAME, Container, HbaseClusterStatus, HbaseRole,
6264
LISTENER_VOLUME_DIR, LISTENER_VOLUME_NAME, merged_env, v1alpha1,
@@ -69,12 +71,7 @@ use crate::{
6971

7072
pub const HBASE_CONTROLLER_NAME: &str = "hbasecluster";
7173
pub const FULL_HBASE_CONTROLLER_NAME: &str = concatcp!(HBASE_CONTROLLER_NAME, '.', OPERATOR_NAME);
72-
pub const MAX_HBASE_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity {
73-
value: 10.0,
74-
unit: BinaryMultiple::Mebi,
75-
};
7674

77-
pub const STACKABLE_LOG_DIR: &str = "/stackable/log";
7875
pub static CONTAINERDEBUG_LOG_DIRECTORY: std::sync::LazyLock<String> =
7976
std::sync::LazyLock::new(|| format!("{STACKABLE_LOG_DIR}/containerdebug"));
8077

@@ -84,8 +81,6 @@ const HDFS_DISCOVERY_TMP_DIR: &str = "/stackable/tmp/hdfs";
8481
const HBASE_CONFIG_TMP_DIR: &str = "/stackable/tmp/hbase";
8582
const HBASE_LOG_CONFIG_TMP_DIR: &str = "/stackable/tmp/log_config";
8683

87-
pub const CONTAINER_IMAGE_BASE_NAME: &str = "hbase";
88-
8984
pub struct Ctx {
9085
pub client: stackable_operator::client::Client,
9186
pub operator_environment: OperatorEnvironmentOptions,
@@ -108,18 +103,20 @@ pub struct ValidatedCluster {
108103
/// Cluster-wide settings resolved once during validation.
109104
#[derive(Clone, Debug)]
110105
pub struct ValidatedClusterConfig {
111-
pub zookeeper_connection_information: ZookeeperConnectionInformation,
106+
// Pre-resolved OPA connection configuration.
112107
pub hbase_opa_config: Option<HbaseOpaConfig>,
113108
pub kerberos_enabled: bool,
114-
/// Pre-resolved kerberos properties for hbase-site.xml (empty when kerberos is disabled).
109+
// Pre-resolved kerberos properties for hbase-site.xml (empty when kerberos is disabled).
115110
pub hbase_site_kerberos_config: BTreeMap<String, String>,
116-
/// Pre-resolved kerberos properties for the discovery `hbase-site.xml` exposed to clients
117-
/// (empty when kerberos is disabled).
111+
// Pre-resolved kerberos properties for the discovery `hbase-site.xml` exposed to clients
112+
// (empty when kerberos is disabled).
118113
pub discovery_kerberos_config: BTreeMap<String, String>,
119-
/// Pre-resolved ssl-server.xml settings (empty when HTTPS is disabled).
114+
// Pre-resolved ssl-server.xml settings (empty when HTTPS is disabled).
120115
pub ssl_server_settings: BTreeMap<String, String>,
121-
/// Pre-resolved ssl-client.xml settings (empty when HTTPS is disabled).
116+
// Pre-resolved ssl-client.xml settings (empty when HTTPS is disabled).
122117
pub ssl_client_settings: BTreeMap<String, String>,
118+
// Pre-resolved zookeeper connection settings.
119+
pub zookeeper_connection_information: ZookeeperConnectionInformation,
123120
}
124121

125122
/// Per-role configuration extracted during validation.

0 commit comments

Comments
 (0)