Skip to content

Commit d5cd9a0

Browse files
committed
fix: Delay controller startup to avoid 404 in initial list
1 parent e11afce commit d5cd9a0

File tree

6 files changed

+50
-43
lines changed

6 files changed

+50
-43
lines changed

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/kafka-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/kafka-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
@@ -19,7 +19,7 @@ use stackable_operator::{
1919
rbac::v1::RoleBinding,
2020
},
2121
kube::{
22-
ResourceExt,
22+
CustomResourceExt, ResourceExt,
2323
core::DeserializeGuard,
2424
runtime::{
2525
Controller,
@@ -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

3737
use crate::{
@@ -209,7 +209,12 @@ async fn main() -> anyhow::Result<()> {
209209
)
210210
.map(anyhow::Ok);
211211

212-
futures::try_join!(kafka_controller, eos_checker, webhook_server)?;
212+
let delayed_kafka_controller = async {
213+
signal::crd_established(&client, v1alpha1::KafkaCluster::crd_name(), None).await?;
214+
kafka_controller.await
215+
};
216+
217+
futures::try_join!(delayed_kafka_controller, eos_checker, webhook_server)?;
213218
}
214219
};
215220

0 commit comments

Comments
 (0)