Skip to content

Commit 80322c2

Browse files
authored
feat: Enable restart controller (#999)
* feat: Enable restart controller * changelog * Use constant * Use op-rs 0.102.0
1 parent e3f51ea commit 80322c2

File tree

7 files changed

+39
-34
lines changed

7 files changed

+39
-34
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ All notable changes to this project will be documented in this file.
99
- Add `ZOOCFGDIR` env var to `/stackable/rwconfig` to improve shell script usage like `zkCleanup.sh` ([#988]).
1010
- Support objectOverrides using `.spec.objectOverrides`.
1111
See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#987]).
12+
- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#999]).
1213

1314
[#987]: https://github.com/stackabletech/zookeeper-operator/pull/987
1415
[#988]: https://github.com/stackabletech/zookeeper-operator/pull/988
16+
[#999]: https://github.com/stackabletech/zookeeper-operator/pull/999
1517

1618
## [25.11.0] - 2025-11-07
1719

Cargo.lock

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

Cargo.nix

Lines changed: 15 additions & 15 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/zookeeper-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.101.2", features = ["telemetry", "versioned"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.102.0", features = ["telemetry", "versioned"] }
1515

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

crate-hashes.json

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

rust/operator-binary/src/zk_controller.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use stackable_operator::{
3333
product_image_selection::{self, ResolvedProductImage},
3434
rbac::build_rbac_resources,
3535
},
36+
constants::RESTART_CONTROLLER_ENABLED_LABEL,
3637
k8s_openapi::{
3738
DeepMerge,
3839
api::{
@@ -486,6 +487,9 @@ pub async fn reconcile_zk(
486487
rolegroup: rolegroup.clone(),
487488
})?;
488489

490+
// Note: The StatefulSet needs to be applied after all ConfigMaps and Secrets it mounts
491+
// to prevent unnecessary Pod restarts.
492+
// See https://github.com/stackabletech/commons-operator/issues/111 for details.
489493
ss_cond_builder.add(
490494
cluster_resources
491495
.add(client, rg_statefulset)
@@ -1019,10 +1023,8 @@ fn build_server_rolegroup_statefulset(
10191023
&rolegroup_ref.role,
10201024
&rolegroup_ref.role_group,
10211025
))
1022-
// The initial restart muddles up the integration tests. This can be re-enabled as soon
1023-
// as https://github.com/stackabletech/commons-operator/issues/111 is implemented.
1024-
// .with_label("restarter.stackable.tech/enabled", "true")
10251026
.context(ObjectMetaSnafu)?
1027+
.with_label(RESTART_CONTROLLER_ENABLED_LABEL.to_owned())
10261028
.build();
10271029

10281030
let statefulset_match_labels =

tests/templates/kuttl/smoke/10-assert.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ apiVersion: apps/v1
99
kind: StatefulSet
1010
metadata:
1111
name: test-zk-server-primary
12+
generation: 1 # There should be no unneeded Pod restarts
1213
spec:
1314
template:
1415
spec:

0 commit comments

Comments
 (0)