diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 4cdaebe4..7d7d37c4 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1175,6 +1175,13 @@ impl AnyServiceConfig { _ => "".to_string(), } } + + pub fn run_region_mover(&self) -> bool { + match self { + AnyServiceConfig::RegionServer(config) => config.region_mover.run_before_shutdown, + _ => false, + } + } } #[cfg(test)] diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index e08a3d1c..0695e1a9 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -807,11 +807,18 @@ fn build_rolegroup_statefulset( let mut merged_env = merged_env(rolegroup_config.get(&PropertyNameKind::Env)); // This env var is set for all roles to avoid bash's "unbound variable" errors - merged_env.push(EnvVar { - name: "REGION_MOVER_OPTS".to_string(), - value: Some(config.region_mover_args()), - ..EnvVar::default() - }); + merged_env.extend([ + EnvVar { + name: "REGION_MOVER_OPTS".to_string(), + value: Some(config.region_mover_args()), + ..EnvVar::default() + }, + EnvVar { + name: "RUN_REGION_MOVER".to_string(), + value: Some(config.run_region_mover().to_string()), + ..EnvVar::default() + }, + ]); let mut hbase_container = ContainerBuilder::new("hbase").expect("ContainerBuilder not created"); hbase_container