Skip to content

Commit 18f8722

Browse files
committed
fix: Delay controller startup to avoid 404 in initial list
1 parent e348fbd commit 18f8722

5 files changed

Lines changed: 52 additions & 43 deletions

File tree

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: 18 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/hdfs-operator"
1111

1212
[workspace.dependencies]
1313
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.106.2", features = ["telemetry", "versioned", "webhook"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.108.0", features = ["crds", "webhook"] }
1515

1616
anyhow = "1.0"
1717
built = { version = "0.8", features = ["chrono", "git2"] }

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: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use stackable_operator::{
1818
core::v1::{ConfigMap, Service},
1919
},
2020
kube::{
21-
Api, ResourceExt,
21+
Api, CustomResourceExt, ResourceExt,
2222
api::PartialObjectMeta,
2323
core::DeserializeGuard,
2424
runtime::{
@@ -31,7 +31,7 @@ use stackable_operator::{
3131
logging::controller::report_controller_reconciled,
3232
shared::yaml::SerializeOptions,
3333
telemetry::Tracing,
34-
utils::signal::SignalWatcher,
34+
utils::signal::{self, SignalWatcher},
3535
};
3636
use tracing::info_span;
3737
use tracing_futures::Instrument;
@@ -215,8 +215,18 @@ async fn main() -> anyhow::Result<()> {
215215
.instrument(info_span!("hdfs_controller"))
216216
.map(anyhow::Ok);
217217

218+
let delayed_hdfs_controller = async {
219+
signal::crd_established(&client, v1alpha1::HdfsCluster::crd_name(), None).await?;
220+
hdfs_controller.await
221+
};
222+
218223
// kube-runtime's Controller will tokio::spawn each reconciliation, so this only concerns the internal watch machinery
219-
futures::try_join!(hdfs_controller, reflector, eos_checker, webhook_server)?;
224+
futures::try_join!(
225+
delayed_hdfs_controller,
226+
webhook_server,
227+
eos_checker,
228+
reflector,
229+
)?;
220230
}
221231
};
222232

0 commit comments

Comments
 (0)