Skip to content

Commit 137cef5

Browse files
committed
chore(stackable-operator): Demote kube_runtime::controller::Error::QueueError to warning
Note: This is because _everything_ was appearing as an error even when it was non-actionable. For example, when the crd maintainer updates the CA bundle on the CRD, the `metadata.resourceVersion changes` as expected. That leads to a controller error. Unfortunately there is currently no good way to discriminate error types. Something might need to be done upstream.
1 parent 29bb731 commit 137cef5

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,26 @@ pub async fn report_controller_reconciled<K, ReconcileErr, QueueErr>(
6161
"Reconciled object"
6262
);
6363
}
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;
64+
Err(controller_error) => {
65+
match controller_error {
66+
// Errors raised from queued stuff we will mark as _warning_.
67+
// We can't easily discriminate any further.
68+
controller::Error::QueueError(queue_error) => tracing::warn!(
69+
controller.name = controller_name,
70+
error = queue_error as &dyn std::error::Error,
71+
"Queued reconcile resulted in an error"
72+
),
73+
// Assume others are _error_ level.
74+
// NOTE (@NickLarsenNZ): Keeping the same error message as before,
75+
// but am not sure if it is correct
76+
_ => tracing::error!(
77+
controller.name = controller_name,
78+
error = controller_error as &dyn std::error::Error,
79+
"Failed to reconcile object"
80+
),
81+
};
82+
83+
publish_controller_error_as_k8s_event(recorder, controller_error).await;
7184
}
7285
}
7386
}

0 commit comments

Comments
 (0)