Skip to content

Commit 9cdd1e1

Browse files
committed
replace parameter with constant
1 parent 1758748 commit 9cdd1e1

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ use crate::{
117117
pub const HIVE_CONTROLLER_NAME: &str = "hivecluster";
118118
pub const HIVE_FULL_CONTROLLER_NAME: &str = concatcp!(HIVE_CONTROLLER_NAME, '.', OPERATOR_NAME);
119119

120-
const CONTAINER_IMAGE_BASE_NAME: &str = "hive";
120+
pub const CONTAINER_IMAGE_BASE_NAME: &str = "hive";
121121

122122
pub const MAX_HIVE_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity {
123123
value: 10.0,
@@ -356,7 +356,6 @@ pub async fn reconcile_hive(
356356

357357
let validated = validate::validate_cluster(
358358
hive,
359-
CONTAINER_IMAGE_BASE_NAME,
360359
&ctx.operator_environment.image_repository,
361360
crate::built_info::PKG_VERSION,
362361
&ctx.product_config,

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

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

1414
use crate::{
15-
controller::ValidatedHiveCluster,
15+
controller::{CONTAINER_IMAGE_BASE_NAME, ValidatedHiveCluster},
1616
crd::{
1717
HIVE_SITE_XML, HiveRole, JVM_SECURITY_PROPERTIES_FILE, MetaStoreConfig,
1818
v1alpha1::{self, HiveMetastoreRoleConfig},
@@ -64,15 +64,14 @@ pub struct ValidatedRoleGroupConfig {
6464

6565
pub fn validate_cluster(
6666
hive: &v1alpha1::HiveCluster,
67-
image_base_name: &str,
6867
image_repository: &str,
6968
pkg_version: &str,
7069
product_config_manager: &ProductConfigManager,
7170
) -> Result<ValidatedHiveCluster, Error> {
7271
let resolved_product_image = hive
7372
.spec
7473
.image
75-
.resolve(image_base_name, image_repository, pkg_version)
74+
.resolve(CONTAINER_IMAGE_BASE_NAME, image_repository, pkg_version)
7675
.context(ResolveProductImageSnafu)?;
7776

7877
let role = hive.spec.metastore.as_ref().context(NoMetaStoreRoleSnafu)?;

0 commit comments

Comments
 (0)