Skip to content

Commit 268ec15

Browse files
committed
replace parameter with compile-time value; rename function
1 parent 9cdd1e1 commit 268ec15

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl ReconcilerError for Error {
330330
/// succeeded for every role and role group before any resources are created.
331331
/// Placed in the controller so that subsequent steps that reference this struct
332332
/// only depend on the controller.
333-
pub struct ValidatedHiveCluster {
333+
pub struct ValidatedCluster {
334334
pub image: ResolvedProductImage,
335335
pub role_groups: BTreeMap<String, ValidatedRoleGroupConfig>,
336336
pub role_config: Option<ValidatedRoleConfig>,
@@ -357,7 +357,6 @@ pub async fn reconcile_hive(
357357
let validated = validate::validate_cluster(
358358
hive,
359359
&ctx.operator_environment.image_repository,
360-
crate::built_info::PKG_VERSION,
361360
&ctx.product_config,
362361
)
363362
.context(ValidateSnafu)?;

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use stackable_operator::{
1212
};
1313

1414
use crate::{
15-
controller::{CONTAINER_IMAGE_BASE_NAME, ValidatedHiveCluster},
15+
controller::{CONTAINER_IMAGE_BASE_NAME, ValidatedCluster},
1616
crd::{
1717
HIVE_SITE_XML, HiveRole, JVM_SECURITY_PROPERTIES_FILE, MetaStoreConfig,
1818
v1alpha1::{self, HiveMetastoreRoleConfig},
@@ -65,13 +65,16 @@ pub struct ValidatedRoleGroupConfig {
6565
pub fn validate_cluster(
6666
hive: &v1alpha1::HiveCluster,
6767
image_repository: &str,
68-
pkg_version: &str,
6968
product_config_manager: &ProductConfigManager,
70-
) -> Result<ValidatedHiveCluster, Error> {
69+
) -> Result<ValidatedCluster, Error> {
7170
let resolved_product_image = hive
7271
.spec
7372
.image
74-
.resolve(CONTAINER_IMAGE_BASE_NAME, image_repository, pkg_version)
73+
.resolve(
74+
CONTAINER_IMAGE_BASE_NAME,
75+
image_repository,
76+
crate::built_info::PKG_VERSION,
77+
)
7578
.context(ResolveProductImageSnafu)?;
7679

7780
let role = hive.spec.metastore.as_ref().context(NoMetaStoreRoleSnafu)?;
@@ -147,7 +150,7 @@ pub fn validate_cluster(
147150
.jdbc_connection_details("METADATA")
148151
.context(InvalidMetadataDatabaseConnectionSnafu)?;
149152

150-
Ok(ValidatedHiveCluster {
153+
Ok(ValidatedCluster {
151154
image: resolved_product_image,
152155
role_groups: group_configs,
153156
role_config,

0 commit comments

Comments
 (0)