Skip to content

Commit 85ff69e

Browse files
authored
fix(webhook): Don't crash on dropped initial_reconcile_tx channel (#1133)
* fix/webhook): Don't crash on dropped initial_reconcile_tx channel * changelog * changelog
1 parent bac8ff4 commit 85ff69e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

crates/stackable-webhook/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Fixed
8+
9+
- Don't error in case the `initial_reconcile` Receiver is dropped ([#1133]).
10+
11+
[#1133]: https://github.com/stackabletech/operator-rs/pull/1133
12+
713
## [0.8.0] - 2025-12-32
814

915
### Added

crates/stackable-webhook/src/webhooks/conversion_webhook.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use kube::{
1818
Api, Client, ResourceExt,
1919
api::{Patch, PatchParams},
2020
};
21-
use snafu::{ResultExt, Snafu, ensure};
21+
use snafu::{ResultExt, Snafu};
2222
use tokio::sync::oneshot;
2323
use tracing::instrument;
2424

@@ -27,9 +27,6 @@ use crate::WebhookServerOptions;
2727

2828
#[derive(Debug, Snafu)]
2929
pub enum ConversionWebhookError {
30-
#[snafu(display("failed to send initial CRD reconcile heartbeat"))]
31-
SendInitialReconcileHeartbeat,
32-
3330
#[snafu(display("failed to patch CRD {crd_name:?}"))]
3431
PatchCrd {
3532
source: kube::Error,
@@ -262,10 +259,9 @@ where
262259
// After the reconciliation of the CRDs, the initial reconcile heartbeat is sent out
263260
// via the oneshot channel.
264261
if let Some(initial_reconcile_tx) = self.initial_reconcile_tx.take() {
265-
ensure!(
266-
initial_reconcile_tx.send(()).is_ok(),
267-
SendInitialReconcileHeartbeatSnafu
268-
);
262+
// This call will (only) error in case the receiver is dropped, so we need to ignore
263+
// failures.
264+
let _ = initial_reconcile_tx.send(());
269265
}
270266

271267
Ok(())

0 commit comments

Comments
 (0)