Skip to content

Commit 29bb731

Browse files
committed
refactor(stackable-operator): Move report_controller_error logic into the caller
1 parent 6132506 commit 29bb731

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

crates/stackable-operator/src/logging/controller.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,13 @@ pub async fn report_controller_reconciled<K, ReconcileErr, QueueErr>(
6161
"Reconciled object"
6262
);
6363
}
64-
Err(err) => report_controller_error(recorder, controller_name, err).await,
64+
Err(error) => {
65+
tracing::error!(
66+
controller.name = controller_name,
67+
error = error as &dyn std::error::Error,
68+
"Failed to reconcile object",
69+
);
70+
publish_controller_error_as_k8s_event(recorder, error).await;
71+
}
6572
}
6673
}
67-
68-
/// Reports an error to the operator administrator and, if relevant, the end user
69-
async fn report_controller_error<ReconcileErr, QueueErr>(
70-
recorder: &Recorder,
71-
controller_name: &str,
72-
error: &controller::Error<ReconcileErr, QueueErr>,
73-
) where
74-
ReconcileErr: ReconcilerError,
75-
QueueErr: std::error::Error,
76-
{
77-
tracing::error!(
78-
controller.name = controller_name,
79-
error = error as &dyn std::error::Error,
80-
"Failed to reconcile object",
81-
);
82-
publish_controller_error_as_k8s_event(recorder, error).await;
83-
}

0 commit comments

Comments
 (0)