Skip to content

Commit 64c7512

Browse files
authored
fix: Delay controller startup to avoid 404 in initial list (#687)
* fix: Delay controller startup to avoid 404 in initial list * chore: Update Cargo.nix * chore: Add changelog entry
1 parent 5ff38dc commit 64c7512

4 files changed

Lines changed: 39 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ All notable changes to this project will be documented in this file.
1414
This behaviour is in line with the default behaviour of Helm and OLM.
1515
- Bump testing-tools to `0.3.0-stackable0.0.0-dev` ([#671]).
1616

17+
### Fixed
18+
19+
- Fix "404 page not found" error for the initial object list ([#687]).
20+
1721
### Removed
1822

1923
- BREAKING: Removed support for ephemeral CSI volumes ([#481], [#670]).
@@ -40,6 +44,7 @@ All notable changes to this project will be documented in this file.
4044
[#671]: https://github.com/stackabletech/secret-operator/pull/671
4145
[#674]: https://github.com/stackabletech/secret-operator/pull/674
4246
[#685]: https://github.com/stackabletech/secret-operator/pull/685
47+
[#687]: https://github.com/stackabletech/secret-operator/pull/687
4348
4449
## [25.11.0] - 2025-11-07
4550

Cargo.nix

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate-hashes.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/main.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This will need changes in our and upstream error types.
33
#![allow(clippy::result_large_err)]
44

5-
use std::{os::unix::prelude::FileTypeExt, path::PathBuf};
5+
use std::{future::Future, os::unix::prelude::FileTypeExt, path::PathBuf};
66

77
use anyhow::{Context, Ok, anyhow};
88
use clap::Parser;
@@ -24,7 +24,6 @@ use stackable_operator::{
2424
telemetry::Tracing,
2525
utils::signal::SignalWatcher,
2626
};
27-
use tokio::sync::oneshot;
2827
use tokio_stream::wrappers::UnixListenerStream;
2928
use tonic::transport::Server;
3029
use utils::{TonicUnixStream, uds_bind_private};
@@ -209,6 +208,12 @@ async fn main() -> anyhow::Result<()> {
209208
)
210209
.await?;
211210

211+
// Here, we multiply the initial reconcile signal received by the oneshot receiver
212+
// to be able to pass it to both the default custom resource deployer and to delay
213+
// the startup of the controller.
214+
let initial_reconcile_signal =
215+
SignalWatcher::new(initial_reconcile_rx.map(|_| ()));
216+
212217
let webhook_server = webhook_server
213218
.run(sigterm_watcher.handle())
214219
.map_err(|err| anyhow!(err).context("failed to run webhook server"));
@@ -217,7 +222,7 @@ async fn main() -> anyhow::Result<()> {
217222
.unwrap_or(operator_environment.operator_namespace.clone());
218223

219224
let default_secretclass = create_default_secretclass(
220-
initial_reconcile_rx,
225+
initial_reconcile_signal.handle(),
221226
ca_secret_namespace,
222227
client.clone(),
223228
)
@@ -232,8 +237,13 @@ async fn main() -> anyhow::Result<()> {
232237
)
233238
.map(anyhow::Ok);
234239

240+
let delayed_truststore_controller = async {
241+
let _ = initial_reconcile_signal.handle().await;
242+
truststore_controller.await
243+
};
244+
235245
try_join!(
236-
truststore_controller,
246+
delayed_truststore_controller,
237247
default_secretclass,
238248
webhook_server,
239249
eos_checker,
@@ -247,11 +257,11 @@ async fn main() -> anyhow::Result<()> {
247257
}
248258

249259
async fn create_default_secretclass(
250-
initial_reconcile_rx: oneshot::Receiver<()>,
260+
initial_reconcile_signal: impl Future<Output = ()>,
251261
ca_secret_namespace: String,
252262
client: Client,
253263
) -> anyhow::Result<()> {
254-
initial_reconcile_rx.await?;
264+
initial_reconcile_signal.await;
255265

256266
tracing::info!("applying default secretclass");
257267

0 commit comments

Comments
 (0)