Skip to content

Commit f5e2676

Browse files
committed
refactor: remove has_kerberos_enabled and has_https_enabled from ValidatedClusterConfig
1 parent 56ba62a commit f5e2676

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

rust/operator-binary/src/controller/build/resource/config_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn build_rolegroup_config_map(
8383
let hbase_env_sh = hbase_env::build(
8484
merged_config,
8585
role,
86-
cluster_config.kerberos_enabled,
86+
cluster.has_kerberos_enabled(),
8787
construct_role_specific_non_heap_jvm_args(cluster, rg),
8888
overrides.hbase_env_sh.clone(),
8989
)

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,14 @@ impl ValidatedCluster {
183183
/// Mirrors [`v1alpha1::HbaseCluster::has_kerberos_enabled`], derived here from the validated
184184
/// config so build steps don't have to re-read the raw cluster.
185185
pub fn has_kerberos_enabled(&self) -> bool {
186-
self.cluster_config.kerberos_enabled
186+
self.cluster_config.kerberos_secret_class.is_some()
187187
}
188188

189189
/// Whether HTTPS is enabled for this cluster.
190+
///
191+
/// Derived from the validated config (a TLS `SecretClass` was configured).
190192
pub fn has_https_enabled(&self) -> bool {
191-
self.cluster_config.https_enabled
193+
self.cluster_config.https_secret_class.is_some()
192194
}
193195
}
194196

@@ -244,9 +246,6 @@ impl NameIsValidLabelValue for ValidatedCluster {
244246
pub struct ValidatedClusterConfig {
245247
// Pre-resolved OPA connection configuration.
246248
pub hbase_opa_config: Option<HbaseOpaConfig>,
247-
pub kerberos_enabled: bool,
248-
/// Whether HTTPS is enabled (a TLS `SecretClass` was configured).
249-
pub https_enabled: bool,
250249
/// The Kerberos `SecretClass` name, if Kerberos is enabled.
251250
pub kerberos_secret_class: Option<SecretClassName>,
252251
/// The HTTPS/TLS `SecretClass` name, if HTTPS is enabled.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ pub fn validate_cluster(
245245
ValidatedClusterConfig {
246246
zookeeper_connection_information: dereferenced_objects.zookeeper_connection_information,
247247
hbase_opa_config: dereferenced_objects.hbase_opa_config,
248-
kerberos_enabled,
249-
https_enabled,
250248
kerberos_secret_class: hbase.kerberos_secret_class(),
251249
https_secret_class: hbase.https_secret_class(),
252250
hdfs_config_map_name: hbase.spec.cluster_config.hdfs_config_map_name.clone(),

0 commit comments

Comments
 (0)