Skip to content

Commit 8ff284f

Browse files
committed
Fix error handling
1 parent 9a9b4dc commit 8ff284f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

rust/operator-binary/src/config/jvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub enum Error {
1616
},
1717
}
1818

19-
// Additionally, any other init or sidecar container must have access to the following settings.
19+
// All init or sidecar containers must have access to the following settings.
2020
// As the Prometheus metric emitter is not part of this config it's safe to use for hdfs cli tools as well.
2121
// This will not only enable the init containers to work, but also the user to run e.g.
2222
// `bin/hdfs dfs -ls /` without getting `Caused by: java.lang.IllegalArgumentException: KrbException: Cannot locate default realm`

rust/operator-binary/src/container.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ impl ContainerConfig {
468468
zookeeper_config_map_name,
469469
env_overrides,
470470
resources.as_ref(),
471-
))
471+
)?)
472472
.add_volume_mounts(self.volume_mounts(hdfs, merged_config, labels)?)
473473
.context(AddVolumeMountSnafu)?
474474
.add_container_ports(self.container_ports(hdfs));
@@ -519,7 +519,7 @@ impl ContainerConfig {
519519
cb.image_from_product_image(resolved_product_image)
520520
.command(Self::command())
521521
.args(self.args(hdfs, cluster_info, role, merged_config, namenode_podrefs)?)
522-
.add_env_vars(self.env(hdfs, zookeeper_config_map_name, env_overrides, None))
522+
.add_env_vars(self.env(hdfs, zookeeper_config_map_name, env_overrides, None)?)
523523
.add_volume_mounts(self.volume_mounts(hdfs, merged_config, labels)?)
524524
.context(AddVolumeMountSnafu)?;
525525

@@ -828,7 +828,7 @@ wait_for_termination $!
828828
zookeeper_config_map_name: &str,
829829
env_overrides: Option<&BTreeMap<String, String>>,
830830
resources: Option<&ResourceRequirements>,
831-
) -> Vec<EnvVar> {
831+
) -> Result<Vec<EnvVar>, Error> {
832832
// Maps env var name to env var object. This allows env_overrides to work
833833
// as expected (i.e. users can override the env var value).
834834
let mut env: BTreeMap<String, EnvVar> = BTreeMap::new();
@@ -857,7 +857,7 @@ wait_for_termination $!
857857
role_opts_name.clone(),
858858
EnvVar {
859859
name: role_opts_name,
860-
value: self.build_hadoop_opts(hdfs, resources).ok(),
860+
value: Some(self.build_hadoop_opts(hdfs, resources)?),
861861
..EnvVar::default()
862862
},
863863
);
@@ -909,7 +909,7 @@ wait_for_termination $!
909909

910910
env.append(&mut env_override_vars);
911911

912-
env.into_values().collect()
912+
Ok(env.into_values().collect())
913913
}
914914

915915
/// Returns the container resources.

0 commit comments

Comments
 (0)