Skip to content

Commit b12d692

Browse files
committed
chore: Add todo comments on unwraps
1 parent f113122 commit b12d692

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

rust/operator-binary/src/crd/logdir.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ impl S3LogDir {
155155
let bucket = log_file_dir
156156
.bucket
157157
.clone()
158+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
158159
.resolve(client, namespace.unwrap().as_str())
159160
.await
160161
.context(ConfigureS3Snafu)?;

rust/operator-binary/src/crd/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ impl v1alpha1::SparkApplication {
838838
product_config: &ProductConfigManager,
839839
) -> Result<ValidatedRoleConfigByPropertyKind, Error> {
840840
let submit_conf = if self.spec.job.is_some() {
841+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
841842
self.spec.job.as_ref().unwrap().clone()
842843
} else {
843844
CommonConfiguration {
@@ -847,6 +848,7 @@ impl v1alpha1::SparkApplication {
847848
};
848849

849850
let driver_conf = if self.spec.driver.is_some() {
851+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
850852
self.spec.driver.as_ref().unwrap().clone()
851853
} else {
852854
CommonConfiguration {
@@ -857,6 +859,7 @@ impl v1alpha1::SparkApplication {
857859

858860
let executor_conf: RoleGroup<RoleConfigFragment, JavaCommonConfig> =
859861
if self.spec.executor.is_some() {
862+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
860863
self.spec.executor.as_ref().unwrap().clone()
861864
} else {
862865
RoleGroup {

rust/operator-binary/src/history/history_controller.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ fn build_service(
629629
Some("None".to_string()),
630630
),
631631
None => (
632+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
632633
format!("{}-{}", shs.metadata.name.as_ref().unwrap(), role),
633634
shs.spec.cluster_config.listener_class.k8s_service_type(),
634635
None,

rust/operator-binary/src/spark_k8s_controller.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ pub async fn reconcile(
233233
s3bd.clone()
234234
.resolve(
235235
client,
236+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
236237
spark_application.metadata.namespace.as_deref().unwrap(),
237238
)
238239
.await
@@ -350,6 +351,7 @@ pub async fn reconcile(
350351

351352
let job_commands = spark_application
352353
.build_command(
354+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
353355
serviceaccount.metadata.name.as_ref().unwrap(),
354356
&opt_s3conn,
355357
&logdir,
@@ -630,6 +632,7 @@ fn pod_template(
630632
logdir,
631633
spark_image,
632634
)
635+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
633636
.unwrap();
634637

635638
for init_container in init_containers {
@@ -968,6 +971,7 @@ fn build_spark_role_serviceaccount(
968971
spark_app: &v1alpha1::SparkApplication,
969972
spark_image: &ResolvedProductImage,
970973
) -> Result<(ServiceAccount, RoleBinding)> {
974+
// TODO (@NickLarsenNZ): Explain this unwrap. Either convert to expect, or gracefully handle the error.
971975
let sa_name = spark_app.metadata.name.as_ref().unwrap().to_string();
972976
let sa = ServiceAccount {
973977
metadata: ObjectMetaBuilder::new()

0 commit comments

Comments
 (0)