Skip to content

Commit 48fe5be

Browse files
committed
fix: Delay controller startup to avoid 404 in initial list
1 parent 59c02aa commit 48fe5be

6 files changed

Lines changed: 50 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/hive-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.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ rules:
9696
{{- if .Values.maintenance.customResourceDefinitions.maintain }}
9797
- create
9898
- patch
99+
# Required for startup condition
100+
- list
101+
- watch
99102
{{- end }}
100103
- apiGroups:
101104
- events.k8s.io

rust/operator-binary/src/main.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use stackable_operator::{
1616
core::v1::{ConfigMap, Service},
1717
},
1818
kube::{
19-
ResourceExt,
19+
CustomResourceExt, ResourceExt,
2020
core::DeserializeGuard,
2121
runtime::{
2222
Controller,
@@ -28,7 +28,7 @@ use stackable_operator::{
2828
logging::controller::report_controller_reconciled,
2929
shared::yaml::SerializeOptions,
3030
telemetry::Tracing,
31-
utils::signal::SignalWatcher,
31+
utils::signal::{self, SignalWatcher},
3232
};
3333

3434
use crate::{
@@ -188,7 +188,12 @@ async fn main() -> anyhow::Result<()> {
188188
)
189189
.map(anyhow::Ok);
190190

191-
futures::try_join!(hive_controller, eos_checker, webhook_server)?;
191+
let delayed_hive_controller = async {
192+
signal::crd_established(&client, v1alpha1::HiveCluster::crd_name(), None).await?;
193+
hive_controller.await
194+
};
195+
196+
futures::try_join!(delayed_hive_controller, eos_checker, webhook_server)?;
192197
}
193198
}
194199

0 commit comments

Comments
 (0)