Skip to content

Commit d01c321

Browse files
committed
use constant for image base name
1 parent 2123858 commit d01c321

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

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

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

14-
use crate::crd::{AnyServiceConfig, HbaseRole, v1alpha1};
14+
use crate::{crd::{AnyServiceConfig, HbaseRole, v1alpha1}, hbase_controller::CONTAINER_IMAGE_BASE_NAME};
1515

1616
#[derive(Snafu, Debug)]
1717
pub enum Error {
@@ -67,15 +67,14 @@ pub struct ValidatedHbaseCluster {
6767

6868
pub fn validate_cluster(
6969
hbase: &v1alpha1::HbaseCluster,
70-
image_base_name: &str,
7170
image_repository: &str,
7271
pkg_version: &str,
7372
product_config_manager: &ProductConfigManager,
7473
) -> Result<ValidatedHbaseCluster, Error> {
7574
let resolved_product_image = hbase
7675
.spec
7776
.image
78-
.resolve(image_base_name, image_repository, pkg_version)
77+
.resolve(CONTAINER_IMAGE_BASE_NAME, image_repository, pkg_version)
7978
.context(ResolveProductImageSnafu)?;
8079

8180
let roles = hbase.build_role_properties().context(RolePropertiesSnafu)?;

rust/operator-binary/src/hbase_controller.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const HDFS_DISCOVERY_TMP_DIR: &str = "/stackable/tmp/hdfs";
103103
const HBASE_CONFIG_TMP_DIR: &str = "/stackable/tmp/hbase";
104104
const HBASE_LOG_CONFIG_TMP_DIR: &str = "/stackable/tmp/log_config";
105105

106-
const CONTAINER_IMAGE_BASE_NAME: &str = "hbase";
106+
pub const CONTAINER_IMAGE_BASE_NAME: &str = "hbase";
107107

108108
pub struct Ctx {
109109
pub client: stackable_operator::client::Client,
@@ -304,7 +304,6 @@ pub async fn reconcile_hbase(
304304

305305
let validated = crate::controller::validate::validate_cluster(
306306
hbase,
307-
CONTAINER_IMAGE_BASE_NAME,
308307
&ctx.operator_environment.image_repository,
309308
crate::built_info::PKG_VERSION,
310309
&ctx.product_config,

0 commit comments

Comments
 (0)