Skip to content

Commit 3abfaa6

Browse files
authored
fix: Bump stackable-operator for delayed controller functionality (#375)
* fix: Delay controller startup to avoid 404 in initial list * chore: Fix clippy lints * chore: Add changelog entry * refactor: Change controller code to be more in line with other core operators
1 parent 5e63e33 commit 3abfaa6

10 files changed

Lines changed: 74 additions & 69 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file.
1313

1414
### Changed
1515

16-
- Bump stackable-operator to 0.106.2 and strum to 0.28 ([#373]).
16+
- Bump stackable-operator to 0.108.0 and strum to 0.28 ([#373], [#375]).
1717
- The operator now deploys the selected ListenerClass preset instead of relying on Helm ([#369]).
1818
- This mechanism is currently tied to CRD maintenance.
1919
- Gracefully shutdown all concurrent tasks by forwarding the SIGTERM signal ([#366]).
@@ -23,6 +23,10 @@ All notable changes to this project will be documented in this file.
2323
This behaviour is in line with the default behaviour of Helm and OLM.
2424
- Bump testing-tools to `0.3.0-stackable0.0.0-dev` ([#363]).
2525

26+
### Fixed
27+
28+
- Fix "404 page not found" error for the initial object list ([#375]).
29+
2630
[#360]: https://github.com/stackabletech/listener-operator/pull/360
2731
[#363]: https://github.com/stackabletech/listener-operator/pull/363
2832
[#364]: https://github.com/stackabletech/listener-operator/pull/364
@@ -31,6 +35,7 @@ All notable changes to this project will be documented in this file.
3135
[#368]: https://github.com/stackabletech/listener-operator/pull/368
3236
[#369]: https://github.com/stackabletech/listener-operator/pull/369
3337
[#373]: https://github.com/stackabletech/listener-operator/pull/373
38+
[#375]: https://github.com/stackabletech/listener-operator/pull/375
3439

3540
## [25.11.0] - 2025-11-07
3641

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ edition = "2021"
1010
repository = "https://github.com/stackabletech/listener-operator"
1111

1212
[workspace.dependencies]
13-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.106.2", features = [
14-
"telemetry",
15-
"versioned",
13+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.108.0", features = [
14+
"crds",
1615
"webhook",
1716
] }
1817

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.

deploy/helm/listener-operator/templates/roles.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,7 @@ rules:
158158
verbs:
159159
- create
160160
- patch
161+
# Required for startup condition
162+
- list
163+
- watch
161164
{{ end }}

rust/olm-deployer/src/env/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ fn deployer_env_var(deployment: &Deployment) -> Option<&Vec<EnvVar>> {
6262
.as_ref()?
6363
.containers
6464
.iter()
65-
.filter(|c| c.name == "listener-operator-deployer")
66-
.next_back()?
65+
.rfind(|c| c.name == "listener-operator-deployer")?
6766
.env
6867
.as_ref()
6968
}

rust/olm-deployer/src/resources/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ fn deployment_resources(deployment: &Deployment) -> Option<&ResourceRequirements
4444
.as_ref()?
4545
.containers
4646
.iter()
47-
.filter(|c| c.name == "listener-operator-deployer")
48-
.next_back()?
47+
.rfind(|c| c.name == "listener-operator-deployer")?
4948
.resources
5049
.as_ref()
5150
}

rust/operator-binary/src/listener_controller.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,11 @@ where
124124
},
125125
)
126126
.graceful_shutdown_on(shutdown_signal)
127-
.run(
128-
reconcile,
129-
error_policy,
130-
Arc::new(Ctx {
131-
client: client.clone(),
132-
}),
133-
)
127+
.run(reconcile, error_policy, Arc::new(Ctx { client }))
134128
// We can let the reporting happen in the background
135129
.for_each_concurrent(
136130
16, // concurrency limit
137-
|result| {
131+
move |result| {
138132
// The event_recorder needs to be shared across all invocations, so that
139133
// events are correctly aggregated
140134
let event_recorder = event_recorder.clone();

rust/operator-binary/src/main.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ use stackable_operator::{
2222
PodListenersVersion, v1alpha1,
2323
},
2424
eos::EndOfSupportChecker,
25-
kube::ResourceExt,
25+
kube::{CustomResourceExt, ResourceExt},
2626
shared::yaml::SerializeOptions,
2727
telemetry::Tracing,
28-
utils::signal::SignalWatcher,
28+
utils::signal::{self, SignalWatcher},
2929
};
3030
use tokio::sync::oneshot;
3131
use tokio_stream::wrappers::UnixListenerStream;
@@ -211,14 +211,21 @@ async fn main() -> anyhow::Result<()> {
211211
.map_err(|err| anyhow!(err).context("failed to run csi server"));
212212

213213
let controller =
214-
listener_controller::run(client, sigterm_watcher.handle()).map(anyhow::Ok);
214+
listener_controller::run(client.clone(), sigterm_watcher.handle())
215+
.map(anyhow::Ok);
216+
217+
let delayed_controller = async {
218+
signal::crd_established(&client, v1alpha1::Listener::crd_name(), None)
219+
.await?;
220+
controller.await
221+
};
215222

216223
futures::try_join!(
224+
delayed_controller,
217225
listener_classes,
218226
webhook_server,
219227
eos_checker,
220228
csi_server,
221-
controller,
222229
)?;
223230
}
224231
RunMode::Node => {

0 commit comments

Comments
 (0)