Skip to content

Commit

Permalink
add RUN_REGION_MOVER env var
Browse files Browse the repository at this point in the history
  • Loading branch information
razvan committed Oct 17, 2024
1 parent 43abf6d commit 2b6e89b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
7 changes: 7 additions & 0 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
17 changes: 12 additions & 5 deletions rust/operator-binary/src/hbase_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b6e89b

Please sign in to comment.