Skip to content

Commit 24b95fa

Browse files
committed
fix: Delay controller startup to avoid 404 in initial list
1 parent af3665d commit 24b95fa

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

deploy/helm/druid-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
- listeners.stackable.tech

rust/operator-binary/src/main.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use stackable_operator::{
1717
core::v1::{ConfigMap, Service},
1818
},
1919
kube::{
20-
ResourceExt,
20+
CustomResourceExt, ResourceExt,
2121
core::DeserializeGuard,
2222
runtime::{
2323
Controller,
@@ -29,7 +29,7 @@ use stackable_operator::{
2929
logging::controller::report_controller_reconciled,
3030
shared::yaml::SerializeOptions,
3131
telemetry::Tracing,
32-
utils::signal::SignalWatcher,
32+
utils::signal::{self, SignalWatcher},
3333
};
3434

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

190-
futures::try_join!(druid_controller, eos_checker, webhook_server)?;
190+
let delayed_druid_controller = async {
191+
signal::crd_established(&client, v1alpha1::DruidCluster::crd_name(), None).await?;
192+
druid_controller.await
193+
};
194+
195+
futures::try_join!(delayed_druid_controller, eos_checker, webhook_server)?;
191196
}
192197
}
193198

0 commit comments

Comments
 (0)