diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ee923b6d..7c79212aa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: - id: cargo-doc-no-default-features name: cargo-doc-no-default-features language: system - entry: cargo doc --no-default-features --document-private-items + entry: cargo doc --no-deps --no-default-features --document-private-items stages: [pre-commit, pre-merge-commit] pass_filenames: false files: \.rs$|Cargo\.(toml|lock) @@ -66,7 +66,7 @@ repos: - id: cargo-doc-all-features name: cargo-doc-all-features language: system - entry: cargo doc --all-features --document-private-items + entry: cargo doc --no-deps --all-features --document-private-items stages: [pre-commit, pre-merge-commit] pass_filenames: false files: \.rs$|Cargo\.(toml|lock) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 55fa43aec..e43940c99 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -8,7 +8,12 @@ All notable changes to this project will be documented in this file. - Add CRD established signal/helper ([#1167]). +## Changed + +- Demote `kube_runtime::controller::Error::QueueError` to warning ([#1168]). + [#1167]: https://github.com/stackabletech/operator-rs/pull/1167 +[#1168]: https://github.com/stackabletech/operator-rs/pull/1168 ## [0.107.0] - 2026-03-09 diff --git a/crates/stackable-operator/src/logging/controller.rs b/crates/stackable-operator/src/logging/controller.rs index 31a3d4d19..a41b73879 100644 --- a/crates/stackable-operator/src/logging/controller.rs +++ b/crates/stackable-operator/src/logging/controller.rs @@ -61,23 +61,26 @@ pub async fn report_controller_reconciled( "Reconciled object" ); } - Err(err) => report_controller_error(recorder, controller_name, err).await, - } -} + Err(controller_error) => { + match controller_error { + // Errors raised from queued stuff we will mark as _warning_. + // We can't easily discriminate any further. + controller::Error::QueueError(queue_error) => tracing::warn!( + controller.name = controller_name, + error = queue_error as &dyn std::error::Error, + "Queued reconcile resulted in an error" + ), + // Assume others are _error_ level. + // NOTE (@NickLarsenNZ): Keeping the same error message as before, + // but am not sure if it is correct + _ => tracing::error!( + controller.name = controller_name, + error = controller_error as &dyn std::error::Error, + "Failed to reconcile object" + ), + }; -/// Reports an error to the operator administrator and, if relevant, the end user -async fn report_controller_error( - recorder: &Recorder, - controller_name: &str, - error: &controller::Error, -) where - ReconcileErr: ReconcilerError, - QueueErr: std::error::Error, -{ - tracing::error!( - controller.name = controller_name, - error = error as &dyn std::error::Error, - "Failed to reconcile object", - ); - publish_controller_error_as_k8s_event(recorder, error).await; + publish_controller_error_as_k8s_event(recorder, controller_error).await; + } + } }